Added form list moving to all lists. BOD-242

This commit is contained in:
Patrick Fic
2020-08-10 09:09:53 -07:00
parent 96d4f0372b
commit 3862f7f11f
6 changed files with 93 additions and 34 deletions

View File

@@ -3,6 +3,7 @@ import { Button, Col, Form, Input, InputNumber, Row } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
//TODO Fix up styles.
import FormListMoveArrows from "../form-list-move-arrows/form-list-move-arrows.component";
export default function ShopInfoSchedulingComponent({ form }) {
const { t } = useTranslation();
@@ -12,7 +13,7 @@ export default function ShopInfoSchedulingComponent({ form }) {
<Row>
<Col span={24}>
<Form.List name={["ssbuckets"]}>
{(fields, { add, remove }) => {
{(fields, { add, remove, move }) => {
return (
<div>
{fields.map((field, index) => (
@@ -88,6 +89,11 @@ export default function ShopInfoSchedulingComponent({ form }) {
remove(field.name);
}}
/>
<FormListMoveArrows
move={move}
index={index}
total={fields.length}
/>
</div>
</Form.Item>
))}