BOD-7 #comment Fixed up employee list + form screen to follow other screens and resolve antd breaking changes.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Button, DatePicker, Form, Input, InputNumber, Switch } from "antd";
|
||||
import moment from "moment";
|
||||
import React from "react";
|
||||
import React, { useEffect } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function ShopEmployeesFormComponent({
|
||||
@@ -9,8 +9,11 @@ export default function ShopEmployeesFormComponent({
|
||||
handleFinish
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
useEffect(() => {
|
||||
if (selectedEmployee) form.resetFields();
|
||||
}, [selectedEmployee, form]);
|
||||
|
||||
if (!selectedEmployee) return "//TODO No employee selected.";
|
||||
if (!selectedEmployee) return null;
|
||||
|
||||
return (
|
||||
<Form
|
||||
@@ -76,7 +79,7 @@ export default function ShopEmployeesFormComponent({
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("employees.fields.flat_rate")}
|
||||
name="active"
|
||||
name="flat_rate"
|
||||
valuePropName="checked"
|
||||
>
|
||||
<Switch />
|
||||
|
||||
Reference in New Issue
Block a user