diff --git a/app/components/Settings.tsx b/app/components/Settings.tsx index 29ba297..ea1a818 100644 --- a/app/components/Settings.tsx +++ b/app/components/Settings.tsx @@ -44,6 +44,10 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = ( const [newEmail, setNewEmail] = useState(''); const [newPassword, setNewPassword] = useState(''); + // Theme selection + const [selectedTheme, setSelectedTheme] = useState('IOMARKET'); // Default value can be 'IOMARKET' + + // Effect to update CSS variables on theme state change useEffect(() => { document.documentElement.style.setProperty('--background-color', backgroundColor); @@ -84,7 +88,7 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = ( popUpTextColor, inputBorderColor, fontFamily, - fontSize + fontSize, ]); const renderSettingsContent = () => { @@ -171,7 +175,7 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = (
- +
); @@ -180,177 +184,300 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = ( return (

Theme Settings

+ + {/* Dropdown to select theme */}
-

Font Size

- { - const newSize = `${e.target.value}px`; - setFontSize(newSize); - document.documentElement.style.setProperty('--font-size', newSize); // Update the CSS variable - }} - /> - {fontSize} -
-
-

Background Color

- setBackgroundColor(e.target.value)} - /> -
-
-

Text Color

- setTextColor(e.target.value)} - /> -
-
-

Input Background Color

- setInputBackgroundColor(e.target.value)} - /> -
-
-

Input Button Color

- setInputButtonColor(e.target.value)} - /> -
-
-

Input Button Hover Color

- setInputButtonHoverColor(e.target.value)} - /> -
-
-

User Message Background Color

- setUserMessageBackgroundColor(e.target.value)} - /> -
-
-

User Message Text Color

- setUserMessageTextColor(e.target.value)} - /> -
-
-

AI Message Background Color

- setAiMessageBackgroundColor(e.target.value)} - /> -
-
-

AI Message Text Color

- setAiMessageTextColor(e.target.value)} - /> -
-
-

Button Background Color

- setButtonBackgroundColor(e.target.value)} - /> -
-
-

Button Hover Background Color

- setButtonHoverBackgroundColor(e.target.value)} - /> -
-
-

Models Background Color

- setModelsBackgroundColor(e.target.value)} - /> -
-
-

History Background Color

- setHistoryBackgroundColor(e.target.value)} - /> -
-
-

Left Panel Background Color

- setLeftPanelBackgroundColor(e.target.value)} - /> -
-
-

Conversation Background Color

- setConversationBackgroundColor(e.target.value)} - /> -
-
-

Pop-up Text Color

- setPopUpTextColor(e.target.value)} - /> -
-
-

Input Border Color

- setInputBorderColor(e.target.value)} - /> -
-
-

Font Family

+

Select Theme

+ + {/* Conditionally render theme settings only if "CUSTOM" is selected */} + {selectedTheme === 'CUSTOM' && ( + <> +
+

Font Size

+ { + const newSize = `${e.target.value}px`; + setFontSize(newSize); + document.documentElement.style.setProperty('--font-size', newSize); // Update the CSS variable + }} + /> + {fontSize} +
+
+

Background Color

+ setBackgroundColor(e.target.value)} + /> +
+
+

Text Color

+ setTextColor(e.target.value)} + /> +
+
+

Input Background Color

+ setInputBackgroundColor(e.target.value)} + /> +
+
+

Input Button Color

+ setInputButtonColor(e.target.value)} + /> +
+
+

Input Button Hover Color

+ setInputButtonHoverColor(e.target.value)} + /> +
+
+

User Message Background Color

+ setUserMessageBackgroundColor(e.target.value)} + /> +
+
+

User Message Text Color

+ setUserMessageTextColor(e.target.value)} + /> +
+
+

AI Message Background Color

+ setAiMessageBackgroundColor(e.target.value)} + /> +
+
+

AI Message Text Color

+ setAiMessageTextColor(e.target.value)} + /> +
+
+

Button Background Color

+ setButtonBackgroundColor(e.target.value)} + /> +
+
+

Button Hover Background Color

+ setButtonHoverBackgroundColor(e.target.value)} + /> +
+
+

Models Background Color

+ setModelsBackgroundColor(e.target.value)} + /> +
+
+

History Background Color

+ setHistoryBackgroundColor(e.target.value)} + /> +
+
+

Left Panel Background Color

+ setLeftPanelBackgroundColor(e.target.value)} + /> +
+
+

Conversation Background Color

+ setConversationBackgroundColor(e.target.value)} + /> +
+
+

Pop-up Text Color

+ setPopUpTextColor(e.target.value)} + /> +
+
+

Input Border Color

+ setInputBorderColor(e.target.value)} + /> +
+
+

Font Family

+ +
+ + )}
); case 'foss': return (
-

FOSS Settings

+

Free and Open Source Software (FOSS) Settings

-

(ONLY OPEN SOURCE MODULES WORK IN THERE)

); @@ -393,10 +519,6 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = ( onChange={(e) => setNewPassword(e.target.value)} /> -
-

DANGER ZONE

- -
); @@ -426,6 +548,7 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = ( + ); };