diff --git a/ui-dashboard/src/components/link-input/link-input.tsx b/ui-dashboard/src/components/link-input/link-input.tsx index 724afc8..bfe5f64 100644 --- a/ui-dashboard/src/components/link-input/link-input.tsx +++ b/ui-dashboard/src/components/link-input/link-input.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import {Form, Select, Space, FormRule, Input} from "antd"; +import {Form, Select, FormRule, Input} from "antd"; interface Props { placeholder: string; @@ -44,16 +44,18 @@ const LinkInput: React.FC = (props: Props) => { style={{width: 300}} required={props.required} > - - - + + } + placeholder={props.placeholder} + /> ); }; diff --git a/ui-dashboard/src/components/merchant-form/merchant-form.tsx b/ui-dashboard/src/components/merchant-form/merchant-form.tsx index f3ac926..ad155db 100644 --- a/ui-dashboard/src/components/merchant-form/merchant-form.tsx +++ b/ui-dashboard/src/components/merchant-form/merchant-form.tsx @@ -1,5 +1,4 @@ import * as React from "react"; -import {useMount} from "react-use"; import {Form, Input, Button, Space, FormInstance} from "antd"; import {Merchant, MerchantBase} from "src/types"; import {sleep} from "src/utils"; @@ -17,14 +16,9 @@ const linkPrefix = "https://"; const MerchantForm: React.FC = (props: Props) => { const [form] = Form.useForm(); - useMount(() => { - if (props.activeMerchant) { - form.setFieldsValue(props.activeMerchant); - } - }); - React.useEffect(() => { if (props.activeMerchant) { + props.activeMerchant.website = props.activeMerchant.website.slice(8); form.setFieldsValue(props.activeMerchant); } }, [props.activeMerchant]); diff --git a/ui-dashboard/src/components/webhook-settings-form/webhook-settings-form.tsx b/ui-dashboard/src/components/webhook-settings-form/webhook-settings-form.tsx index 8257228..5d1d503 100644 --- a/ui-dashboard/src/components/webhook-settings-form/webhook-settings-form.tsx +++ b/ui-dashboard/src/components/webhook-settings-form/webhook-settings-form.tsx @@ -18,7 +18,7 @@ const WebhookSettingsForm: React.FC = (props: Props) => { React.useEffect(() => { if (props.webhookSettings) { - form.setFieldsValue(props.webhookSettings); + form.setFieldsValue({...props.webhookSettings, url: props.webhookSettings.url.slice(8)}); } }, [props.webhookSettings]);