summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2021-04-25 00:39:45 +0300
committereug-vs <eug-vs@keemail.me>2021-04-25 00:39:45 +0300
commitb8bd395c40b4cc94604ebfbaf5417a145ba394f1 (patch)
tree848840b017d83ee0b304140a76874d8d50d6c13c
parentd781d391241746be086db7dbef6d5361c735de6c (diff)
downloadcommercel-ui-b8bd395c40b4cc94604ebfbaf5417a145ba394f1.tar.gz
feat: add Account form
-rw-r--r--src/services/accounts/AccountForm.tsx22
-rw-r--r--src/services/accounts/index.ts2
2 files changed, 24 insertions, 0 deletions
diff --git a/src/services/accounts/AccountForm.tsx b/src/services/accounts/AccountForm.tsx
new file mode 100644
index 0000000..fe834ed
--- /dev/null
+++ b/src/services/accounts/AccountForm.tsx
@@ -0,0 +1,22 @@
+import React from 'react';
+import { Form } from 'formik';
+import Input from '../../components/Input';
+import Select from '../../components/Select';
+
+const currencyOptions = [
+ { key: 'BYN', label: 'BYN' },
+ { key: 'USD', label: 'USD' },
+ { key: 'EUR', label: 'EUR' },
+];
+
+const AccountForm: React.FC = () => {
+ return (
+ <Form id="form">
+ <Input name="name" label="Название" />
+ <Input name="code" label="Номер счёта" />
+ <Select name="currency" label="Валюта" options={currencyOptions} />
+ </Form>
+ );
+};
+
+export default AccountForm;
diff --git a/src/services/accounts/index.ts b/src/services/accounts/index.ts
index 1936a9c..0200e15 100644
--- a/src/services/accounts/index.ts
+++ b/src/services/accounts/index.ts
@@ -1,5 +1,6 @@
import { ServiceParams } from '../../lib/ServiceContext';
import { Account } from '../types';
+import Form from './AccountForm';
const service: ServiceParams<Account> = {
route: 'accounts',
@@ -15,6 +16,7 @@ const service: ServiceParams<Account> = {
name: '',
balance: 0,
},
+ Form,
};
export default service;