From d65ffe55b933863a51b9fa4dcae7c2d32b942dd8 Mon Sep 17 00:00:00 2001 From: Valery <57412523+valerydluski@users.noreply.github.com> Date: Wed, 3 Jul 2024 11:47:59 +0200 Subject: [PATCH] refactor: update SettingsModal on score page (#2500) --- .../Score/components/SettingsModal/index.tsx | 47 ++++++------------- 1 file changed, 14 insertions(+), 33 deletions(-) diff --git a/client/src/modules/Score/components/SettingsModal/index.tsx b/client/src/modules/Score/components/SettingsModal/index.tsx index 03775c5c29..3fd519ac3a 100644 --- a/client/src/modules/Score/components/SettingsModal/index.tsx +++ b/client/src/modules/Score/components/SettingsModal/index.tsx @@ -1,4 +1,4 @@ -import { Button, Checkbox, Form, Modal } from 'antd'; +import { Button, Checkbox, Form, Modal, Row, Col } from 'antd'; import { Store } from 'rc-field-form/lib/interface'; import type { CourseTaskDto } from 'api'; @@ -31,10 +31,9 @@ export function SettingsModal(props: Props) { const fillAllFields = (value: boolean) => { const newValues: Record = {}; - courseTasks.reduce((acc, curr) => { - acc[curr.id] = value; - return acc; - }, newValues); + courseTasks.forEach(task => { + newValues[task.id] = value; + }); form.setFieldsValue(newValues); }; @@ -59,34 +58,16 @@ export function SettingsModal(props: Props) { , ]} > -
- {courseTasks.map(el => ( - - - - ))} + + + {courseTasks.map(courseTask => ( + + + {courseTask.name} + + + ))} +
);