refactor: move constants

This commit is contained in:
Maël Gangloff
2025-02-18 21:42:15 +01:00
parent 58bd2f7559
commit 5e66ba9c35
10 changed files with 89 additions and 95 deletions

View File

@@ -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

View File

@@ -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.`}
&nbsp;
<Typography.Link href={providersConfig()[connector.provider].tosLink}>
<Typography.Link href={providersConfig[connector.provider].tosLink}>
{t`The Providers conditions are accessible by following this hyperlink.`}
</Typography.Link>
</>

View File

@@ -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`}