From 6435d5f4e4e4fc8a4406929504a2f3b5ea88ebe5 Mon Sep 17 00:00:00 2001 From: sageTheDM Date: Thu, 3 Oct 2024 16:11:53 +0200 Subject: [PATCH] Setting radioSelection --- app/components/settings/PrivacySettings.tsx | 64 +++++++++------------ app/components/settings/Settings.tsx | 1 - 2 files changed, 26 insertions(+), 39 deletions(-) diff --git a/app/components/settings/PrivacySettings.tsx b/app/components/settings/PrivacySettings.tsx index 7dadb51..02d551f 100644 --- a/app/components/settings/PrivacySettings.tsx +++ b/app/components/settings/PrivacySettings.tsx @@ -11,50 +11,38 @@ const PrivacySettings: React.FC = ({ selectedOption, handl // Set default option based on openSourceMode if no option is selected useEffect(() => { if (!selectedOption) { - handleRadioChange(openSourceMode ? 'Offline' : 'None'); + handleRadioChange(openSourceMode ? 'Offline (FOSS)' : 'None'); } }, [selectedOption, handleRadioChange, openSourceMode]); - // Handle option click, allowing all options even in open-source mode - const handleOptionClick = (option: string) => { - handleRadioChange(option); // No restrictions on options - }; + // Define your options + const options = [ + { value: 'Online', label: 'Online' }, + { value: 'Offline', label: 'Offline' }, + { value: 'None', label: 'None' }, + { value: 'Offline (FOSS)', label: 'Offline (FOSS)' }, + { value: 'Online (FOSS)', label: 'Online (FOSS)' }, + { value: 'None (FOSS)', label: 'None (FOSS)' }, + ]; return ( - <> - {/* AI Mode Radio Options */} -
-

{openSourceMode ? 'Disable Options (FOSS Mode):' : 'Disable Options:'}

-
- {/* Offline */} -
handleOptionClick('Offline')} - style={{ pointerEvents: (openSourceMode && selectedOption !== 'Offline') ? 'none' : 'auto', opacity: (openSourceMode && selectedOption !== 'Offline') ? 0.5 : 1 }} - > - Offline tools{openSourceMode ? ' (FOSS)' : ''} -
- - {/* Online (Available even in FOSS mode) */} -
handleOptionClick('Online')} - > - Online tools{openSourceMode ? ' (FOSS)' : ''} -
- - {/* None */} -
handleOptionClick('None')} - style={{ pointerEvents: (openSourceMode && selectedOption !== 'None') ? 'none' : 'auto', opacity: (openSourceMode && selectedOption !== 'None') ? 0.5 : 1 }} - > - None{openSourceMode ? ' (FOSS)' : ''} -
+
+

Select Privacy Mode:

+ {options.map((option) => ( +
+
-
-
- + ))} +
); }; diff --git a/app/components/settings/Settings.tsx b/app/components/settings/Settings.tsx index 18fb661..ac94db3 100644 --- a/app/components/settings/Settings.tsx +++ b/app/components/settings/Settings.tsx @@ -458,7 +458,6 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = ( return (

Privacy Settings

-