You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.3 KiB
62 lines
1.3 KiB
import { Fragment } from 'react'
|
|
|
|
import { OutsideClick } from 'features/OutsideClick'
|
|
|
|
import { APISettings } from './components/APISettings'
|
|
import { useSystemSettings } from './hooks'
|
|
|
|
import {
|
|
FadeIn,
|
|
Form,
|
|
Content,
|
|
Footer,
|
|
Header,
|
|
HeaderTitle,
|
|
TriggerButton,
|
|
ApplyButton,
|
|
CloseButton,
|
|
} from './styled'
|
|
|
|
const SystemSettings = () => {
|
|
const {
|
|
close,
|
|
isOpen,
|
|
onSubmit,
|
|
open,
|
|
selectedApi,
|
|
} = useSystemSettings()
|
|
|
|
return (
|
|
<Fragment>
|
|
<TriggerButton aria-label='Settings' onClick={open} />
|
|
{
|
|
isOpen && (
|
|
<FadeIn>
|
|
<OutsideClick onClick={close}>
|
|
<Form onSubmit={onSubmit}>
|
|
<Header>
|
|
<HeaderTitle>Настройки</HeaderTitle>
|
|
<CloseButton
|
|
aria-label='Close'
|
|
type='button'
|
|
onClick={close}
|
|
>
|
|
X
|
|
</CloseButton>
|
|
</Header>
|
|
<Content>
|
|
<APISettings selectedApi={selectedApi} />
|
|
</Content>
|
|
<Footer>
|
|
<ApplyButton>Применить</ApplyButton>
|
|
</Footer>
|
|
</Form>
|
|
</OutsideClick>
|
|
</FadeIn>
|
|
)
|
|
}
|
|
</Fragment>
|
|
)
|
|
}
|
|
|
|
export default SystemSettings
|
|
|