From b4aa411826dcf521ec8ca04851d8aae83b44e334 Mon Sep 17 00:00:00 2001 From: Ildar Kamalov Date: Fri, 17 Jan 2025 16:54:55 +0300 Subject: [PATCH] fix checkbox field --- client/src/components/Filters/FiltersList.tsx | 10 ++------- .../components/Settings/Dns/Config/Form.tsx | 22 +++++-------------- .../components/Settings/Dns/Upstream/Form.tsx | 12 ++++------ .../Settings/FiltersConfig/index.tsx | 6 ++--- .../components/Settings/LogsConfig/Form.tsx | 16 +++----------- .../components/Settings/StatsConfig/Form.tsx | 10 +-------- 6 files changed, 18 insertions(+), 58 deletions(-) diff --git a/client/src/components/Filters/FiltersList.tsx b/client/src/components/Filters/FiltersList.tsx index b56d0d34..fb9bedb7 100644 --- a/client/src/components/Filters/FiltersList.tsx +++ b/client/src/components/Filters/FiltersList.tsx @@ -73,14 +73,8 @@ export const FiltersList = ({ categories, filters, selectedSources }: Props) => ( - onChange(value)} - disabled={isSelected} - /> + render={({ field }) => ( + )} /> {renderIcons(iconsData)} diff --git a/client/src/components/Settings/Dns/Config/Form.tsx b/client/src/components/Settings/Dns/Config/Form.tsx index 15378361..4b996251 100644 --- a/client/src/components/Settings/Dns/Config/Form.tsx +++ b/client/src/components/Settings/Dns/Config/Form.tsx @@ -193,14 +193,8 @@ const Form = ({ processing, initialValues, onSubmit }: Props) => { ( - onChange(value)} - disabled={processing} - /> + render={({ field }) => ( + )} /> @@ -211,12 +205,10 @@ const Form = ({ processing, initialValues, onSubmit }: Props) => { ( + render={({ field }) => ( onChange(value)} disabled={processing || !edns_cs_enabled} /> )} @@ -243,13 +235,11 @@ const Form = ({ processing, initialValues, onSubmit }: Props) => { ( + render={({ field }) => ( onChange(value)} disabled={processing} /> )} diff --git a/client/src/components/Settings/Dns/Upstream/Form.tsx b/client/src/components/Settings/Dns/Upstream/Form.tsx index da8c21dc..e0dcf3f7 100644 --- a/client/src/components/Settings/Dns/Upstream/Form.tsx +++ b/client/src/components/Settings/Dns/Upstream/Form.tsx @@ -273,13 +273,11 @@ const Form = ({ initialValues, onSubmit }: FormProps) => { ( + render={({ field }) => ( onChange(value)} disabled={processingSetConfig} /> )} @@ -295,13 +293,11 @@ const Form = ({ initialValues, onSubmit }: FormProps) => { ( + render={({ field }) => ( onChange(value)} disabled={processingSetConfig} /> )} diff --git a/client/src/components/Settings/FiltersConfig/index.tsx b/client/src/components/Settings/FiltersConfig/index.tsx index ececada3..6db7b204 100644 --- a/client/src/components/Settings/FiltersConfig/index.tsx +++ b/client/src/components/Settings/FiltersConfig/index.tsx @@ -60,12 +60,10 @@ export const FiltersConfig = ({ initialValues, setFiltersConfig, processing }: P ( + render={({ field }) => ( onChange(value)} disabled={processing} /> )} diff --git a/client/src/components/Settings/LogsConfig/Form.tsx b/client/src/components/Settings/LogsConfig/Form.tsx index 33c7296b..7238b7cc 100644 --- a/client/src/components/Settings/LogsConfig/Form.tsx +++ b/client/src/components/Settings/LogsConfig/Form.tsx @@ -91,15 +91,7 @@ export const Form = ({ initialValues, processing, processingReset, onSubmit, onR ( - onChange(value)} - disabled={processing} - /> - )} + render={({ field }) => } /> @@ -107,13 +99,11 @@ export const Form = ({ initialValues, processing, processingReset, onSubmit, onR ( + render={({ field }) => ( onChange(value)} disabled={processing} /> )} diff --git a/client/src/components/Settings/StatsConfig/Form.tsx b/client/src/components/Settings/StatsConfig/Form.tsx index bab0e19c..f4ffd2b2 100644 --- a/client/src/components/Settings/StatsConfig/Form.tsx +++ b/client/src/components/Settings/StatsConfig/Form.tsx @@ -87,15 +87,7 @@ export const Form = ({ initialValues, processing, processingReset, onSubmit, onR ( - onChange(value)} - disabled={processing} - /> - )} + render={({ field }) => } />