Fixed linting

pull/5370/head
ioedeveloper 4 years ago
parent 6d1e8fe1d7
commit cc9e0ab19a
  1. 38
      libs/remix-ui/modal-dialog/src/lib/remix-ui-modal-dialog.tsx

@ -1,5 +1,5 @@
import React, { useRef, useState, useEffect } from 'react'
import { ModalDialogProps } from './types'
import React, { useRef, useState, useEffect } from 'react' // eslint-disable-line
import { ModalDialogProps } from './types' // eslint-disable-line
import './remix-ui-modal-dialog.css'
@ -12,7 +12,7 @@ export const ModalDialog = (props: ModalDialogProps) => {
props.hide()
}
useEffect (
useEffect(
() => {
modal.current.focus()
}, []
@ -26,13 +26,13 @@ export const ModalDialog = (props: ModalDialogProps) => {
enterHandler()
} else if (keyCode === 37) {
// todo && footerIsActive) { // Arrow Left
setState((prevState)=>{return {...prevState, toggleBtn: true}})
setState((prevState) => { return { ...prevState, toggleBtn: true } })
} else if (keyCode === 39) {
// todo && footerIsActive) { // Arrow Right
setState((prevState)=>{return {...prevState, toggleBtn: false}})
setState((prevState) => { return { ...prevState, toggleBtn: false } })
}
}
const enterHandler = () => {
if (state.toggleBtn) {
if (props.ok && props.ok.fn) props.ok.fn()
@ -45,10 +45,10 @@ export const ModalDialog = (props: ModalDialogProps) => {
<div
id="modal-dialog"
data-id="modalDialogContainer"
data-backdrop="static"
data-backdrop="static"
data-keyboard="false"
tabIndex={-1}
className={"modal d-block"}
className="modal d-block"
role="dialog"
>
<div id="modal-background" className="modal-dialog" role="document">
@ -59,12 +59,12 @@ export const ModalDialog = (props: ModalDialogProps) => {
handleHide()
}}
ref={modal}
className={"modal-content remixModalContent " + (props.opts ? props.opts.class ? props.opts.class : '': '')}
onKeyDown={({keyCode})=>{modalKeyEvent(keyCode)}}
className={'modal-content remixModalContent ' + (props.opts ? props.opts.class ? props.opts.class : '' : '')}
onKeyDown={({ keyCode }) => { modalKeyEvent(keyCode) }}
>
<div className="modal-header">
<h6 className="modal-title" data-id="modalDialogModalTitle">
{props.title && props.title}
{props.title && props.title}
</h6>
{!props.opts.hideClose &&
<span className="modal-close" onClick={() => handleHide()}>
@ -82,19 +82,19 @@ export const ModalDialog = (props: ModalDialogProps) => {
{props.ok &&
<span
id="modal-footer-ok"
className={"modal-ok btn btn-sm " + (state.toggleBtn ? "btn-dark" : "btn-light")}
className={'modal-ok btn btn-sm ' + (state.toggleBtn ? 'btn-dark' : 'btn-light')}
onClick={() => {
if (props.ok && props.ok.fn) props.ok.fn()
handleHide()
}}
tabIndex={1}
>
{props.ok && props.ok.label ? props.ok.label: 'OK'}
{props.ok && props.ok.label ? props.ok.label : 'OK'}
</span>
}
<span
id="modal-footer-cancel"
className={"modal-cancel btn btn-sm " + (state.toggleBtn ? "btn-light" : "btn-dark")}
className={'modal-cancel btn btn-sm ' + (state.toggleBtn ? 'btn-light' : 'btn-dark')}
data-dismiss="modal"
onClick={() => {
if (props.cancel && props.cancel.fn) props.cancel.fn()
@ -102,13 +102,13 @@ export const ModalDialog = (props: ModalDialogProps) => {
}}
tabIndex={2}
>
{props.cancel && props.cancel.label ? props.cancel.label: 'Cancel'}
</span>
{props.cancel && props.cancel.label ? props.cancel.label : 'Cancel'}
</span>
</div>
</div>
</div>
</div>
</>);
};
</>)
}
export default ModalDialog;
export default ModalDialog

Loading…
Cancel
Save