From 23d732135d949f897c16700ecffcf2386ad0eaf9 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Wed, 7 Jul 2021 10:16:54 +0100 Subject: [PATCH] Fix react warning in settings tab --- .../settings/src/lib/remix-ui-settings.tsx | 70 +++++++++++-------- 1 file changed, 39 insertions(+), 31 deletions(-) diff --git a/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx b/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx index adf92ae393..2d20ecf83c 100644 --- a/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx +++ b/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx @@ -71,39 +71,47 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => { } } - const generalConfig = () => ( -
-
-
General settings
-
- - -
-
- - -
-
- - -
-
- - -
-
- - + const generalConfig = () => { + const isMetadataChecked = (props.config.get('settings/generate-contract-metadata') === null) || (props.config.get('settings/generate-contract-metadata') === undefined) ? false : props.config.get('settings/generate-contract-metadata') + const isEthereumVMChecked = (props.config.get('settings/always-use-vm') === null) || (props.config.get('settings/always-use-vm') === undefined) ? false : props.config.get('settings/always-use-vm') + const isEditorWrapChecked = (props.config.get('settings/text-wrap') === null) || (props.config.get('settings/text-wrap') === undefined) ? false : props.config.get('settings/text-wrap') + const isPersonalChecked = (props.config.get('settings/personal-mode') === null) || (props.config.get('settings/personal-mode') === undefined) ? false : props.config.get('settings/personal-mode') + const isMatomoChecked = (props.config.get('settings/matomo-analytics') === null) || (props.config.get('settings/matomo-analytics') === undefined) ? false : props.config.get('settings/matomo-analytics') + + return ( +
+
+
General settings
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
-
- ) + ) + } const saveToken = () => { saveTokenToast(props.config, dispatchToast, tokenValue)