mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
refactor: move constants
This commit is contained in:
@@ -10,10 +10,9 @@ import {providersConfig} from "../../../utils/providers"
|
||||
|
||||
export function ConnectorForm({form, onCreate}: { form: FormInstance, onCreate: (values: Connector) => void }) {
|
||||
const [provider, setProvider] = useState<ConnectorProvider>()
|
||||
const providersConfigList = providersConfig()
|
||||
const [current, setCurrent] = useState(0)
|
||||
|
||||
const ProviderForm = provider !== undefined ? providersConfigList[provider].form : undefined
|
||||
const ProviderForm = provider !== undefined ? providersConfig[provider].form : undefined
|
||||
|
||||
const steps: StepProps[] = [
|
||||
{
|
||||
@@ -38,7 +37,7 @@ export function ConnectorForm({form, onCreate}: { form: FormInstance, onCreate:
|
||||
<>
|
||||
<h2>{t`Choose a registrar`}</h2>
|
||||
<Row gutter={[16, 16]}>
|
||||
{Object.keys(providersConfigList).map((provider: string) => (
|
||||
{Object.keys(providersConfig).map((provider: string) => (
|
||||
<Col key={provider as ConnectorProvider} span={8}>
|
||||
<Card
|
||||
hoverable
|
||||
|
||||
@@ -50,7 +50,7 @@ export function ConnectorsList({connectors, onDelete}: { connectors: ConnectorEl
|
||||
{t`You can stop using a connector at any time. To delete a connector, you must remove it from each linked Watchlist.
|
||||
The creation date corresponds to the date on which you consented to the creation of the connector and on which you declared in particular that you fulfilled the conditions of use of the supplier's API, waived the right of withdrawal and were of the minimum age to consent to these conditions.`}
|
||||
|
||||
<Typography.Link href={providersConfig()[connector.provider].tosLink}>
|
||||
<Typography.Link href={providersConfig[connector.provider].tosLink}>
|
||||
{t`The Provider’s conditions are accessible by following this hyperlink.`}
|
||||
</Typography.Link>
|
||||
</>
|
||||
|
||||
@@ -269,7 +269,7 @@ export function WatchlistForm({form, connectors, onFinish, isCreation}: {
|
||||
</>
|
||||
)}
|
||||
</Form.List>
|
||||
<Form.Item style={{marginTop: '5vh'}}>
|
||||
<Form.Item style={{marginTop: '5em'}}>
|
||||
<Space>
|
||||
<Button type='primary' htmlType='submit'>
|
||||
{isCreation ? t`Create` : t`Update`}
|
||||
|
||||
Reference in New Issue
Block a user