Skip to content

Commit

Permalink
Merge pull request #18 from oxygenpay/develop
Browse files Browse the repository at this point in the history
merge: develop
  • Loading branch information
swift1337 committed Jul 25, 2023
2 parents 5830ad4 + a419aa3 commit 4173ea8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
24 changes: 13 additions & 11 deletions 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;
Expand Down Expand Up @@ -44,16 +44,18 @@ const LinkInput: React.FC<Props> = (props: Props) => {
style={{width: 300}}
required={props.required}
>
<Space.Compact>
<Select
defaultValue="https://"
options={[{value: "https://", label: "https://"}]}
className="withdraw-form__currency-selection"
disabled
showArrow={false}
/>
<Input placeholder={props.placeholder} />
</Space.Compact>
<Input
addonBefore={
<Select
defaultValue="https://"
options={[{value: "https://", label: "https://"}]}
className="withdraw-form__currency-selection"
disabled
showArrow={false}
/>
}
placeholder={props.placeholder}
/>
</Form.Item>
);
};
Expand Down
8 changes: 1 addition & 7 deletions 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";
Expand All @@ -17,14 +16,9 @@ const linkPrefix = "https://";
const MerchantForm: React.FC<Props> = (props: Props) => {
const [form] = Form.useForm<MerchantBase>();

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]);
Expand Down
Expand Up @@ -18,7 +18,7 @@ const WebhookSettingsForm: React.FC<Props> = (props: Props) => {

React.useEffect(() => {
if (props.webhookSettings) {
form.setFieldsValue(props.webhookSettings);
form.setFieldsValue({...props.webhookSettings, url: props.webhookSettings.url.slice(8)});
}
}, [props.webhookSettings]);

Expand Down

0 comments on commit 4173ea8

Please sign in to comment.