From da9e98edf99c6392122c81e0c4fcd00d84b62307 Mon Sep 17 00:00:00 2001 From: sageTheDM Date: Fri, 11 Oct 2024 09:34:28 +0200 Subject: [PATCH] Setting comments --- app/components/settings/Settings.tsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/components/settings/Settings.tsx b/app/components/settings/Settings.tsx index 83612d0..a5c72c0 100644 --- a/app/components/settings/Settings.tsx +++ b/app/components/settings/Settings.tsx @@ -65,7 +65,7 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = ( // Measurement setting const [preferredMeasurement, setPreferredMeasurement] = useState(() => localStorage.getItem('preferredMeasurement') || 'Metric'); - // Theme settings + //#region Theme settings const [backgroundColor, setBackgroundColor] = useState(() => getComputedStyle(document.documentElement).getPropertyValue('--background-color').trim()); const [headerBackground, setHeaderBackground] = useState(() => getComputedStyle(document.documentElement).getPropertyValue('--header-background-color').trim()); const [textColor, setTextColor] = useState(() => getComputedStyle(document.documentElement).getPropertyValue('--text-color').trim()); @@ -122,6 +122,7 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = ( const [google, setGoogle] = useState(localStorage.getItem('google') || ""); const [myBoolean, setMyBoolean] = useState(() => getItemFromLocalStorage('myBoolean')); + //#region Json const settings = { userPreferences: { activeSection, @@ -185,6 +186,7 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = ( }, }; + //#region color settings const colorSettings = [ { name: "Background Color", value: backgroundColor, setValue: setBackgroundColor, cssVariable: "--background-color" }, { name: "Header Background Color", value: headerBackground, setValue: setHeaderBackground, cssVariable: "--header-background-color" }, @@ -219,7 +221,7 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = ( { name: "Burger Menu Background Color", value: burgerMenuBackgroundColor, setValue: setBurgerMenuBackgroundColor, cssVariable: "--burger-menu-background-color" }, ]; - + //#region time settings const timeZoneOptions = [ { value: 'GMT', label: 'GMT' }, { value: 'EST', label: 'EST' }, @@ -233,7 +235,7 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = ( { value: 'JST', label: 'JST' }, ]; - + //#region language settings const languageOptions = [ { code: 'en', name: 'English' }, { code: 'es', name: 'Spanish' }, @@ -246,7 +248,7 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = ( { code: 'ru', name: 'Russian' }, { code: 'ar', name: 'Arabic' }, ]; - + //#region currency settings const currencyOptions = [ { code: 'usd', name: 'USD' }, { code: 'eur', name: 'EUR' }, @@ -258,7 +260,7 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = ( { code: 'cny', name: 'CNY' }, { code: 'inr', name: 'INR' }, ]; - + //#region date settings const dateFormatOptions = [ { value: 'mm/dd/yyyy', label: 'MM/DD/YYYY' }, { value: 'dd/mm/yyyy', label: 'DD/MM/YYYY' }, @@ -276,7 +278,7 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = ( { value: 'Metric', label: 'Metric' }, { value: 'Imperial', label: 'Imperial' }, ]; - + //#region text settings const fontOptions = [ { value: "'Poppins', sans-serif", label: 'Poppins' }, { value: "'Inconsolata', monospace", label: 'Inconsolata' }, @@ -294,7 +296,7 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = ( { value: "'Zilla Slab Highlight', serif", label: 'Zilla Slab Highlight' }, ]; - //#region Start of the code + //#region Function const handleLogout = () => { localStorage.clear(); alert('Successfully logged out!');