Setting comments
This commit is contained in:
parent
da480b9835
commit
da9e98edf9
1 changed files with 9 additions and 7 deletions
|
@ -65,7 +65,7 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = (
|
||||||
// Measurement setting
|
// Measurement setting
|
||||||
const [preferredMeasurement, setPreferredMeasurement] = useState(() => localStorage.getItem('preferredMeasurement') || 'Metric');
|
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 [backgroundColor, setBackgroundColor] = useState(() => getComputedStyle(document.documentElement).getPropertyValue('--background-color').trim());
|
||||||
const [headerBackground, setHeaderBackground] = useState(() => getComputedStyle(document.documentElement).getPropertyValue('--header-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());
|
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 [google, setGoogle] = useState(localStorage.getItem('google') || "");
|
||||||
const [myBoolean, setMyBoolean] = useState<boolean>(() => getItemFromLocalStorage('myBoolean'));
|
const [myBoolean, setMyBoolean] = useState<boolean>(() => getItemFromLocalStorage('myBoolean'));
|
||||||
|
|
||||||
|
//#region Json
|
||||||
const settings = {
|
const settings = {
|
||||||
userPreferences: {
|
userPreferences: {
|
||||||
activeSection,
|
activeSection,
|
||||||
|
@ -185,6 +186,7 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = (
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//#region color settings
|
||||||
const colorSettings = [
|
const colorSettings = [
|
||||||
{ name: "Background Color", value: backgroundColor, setValue: setBackgroundColor, cssVariable: "--background-color" },
|
{ name: "Background Color", value: backgroundColor, setValue: setBackgroundColor, cssVariable: "--background-color" },
|
||||||
{ name: "Header Background Color", value: headerBackground, setValue: setHeaderBackground, cssVariable: "--header-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" },
|
{ name: "Burger Menu Background Color", value: burgerMenuBackgroundColor, setValue: setBurgerMenuBackgroundColor, cssVariable: "--burger-menu-background-color" },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
//#region time settings
|
||||||
const timeZoneOptions = [
|
const timeZoneOptions = [
|
||||||
{ value: 'GMT', label: 'GMT' },
|
{ value: 'GMT', label: 'GMT' },
|
||||||
{ value: 'EST', label: 'EST' },
|
{ value: 'EST', label: 'EST' },
|
||||||
|
@ -233,7 +235,7 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = (
|
||||||
{ value: 'JST', label: 'JST' },
|
{ value: 'JST', label: 'JST' },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
//#region language settings
|
||||||
const languageOptions = [
|
const languageOptions = [
|
||||||
{ code: 'en', name: 'English' },
|
{ code: 'en', name: 'English' },
|
||||||
{ code: 'es', name: 'Spanish' },
|
{ code: 'es', name: 'Spanish' },
|
||||||
|
@ -246,7 +248,7 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = (
|
||||||
{ code: 'ru', name: 'Russian' },
|
{ code: 'ru', name: 'Russian' },
|
||||||
{ code: 'ar', name: 'Arabic' },
|
{ code: 'ar', name: 'Arabic' },
|
||||||
];
|
];
|
||||||
|
//#region currency settings
|
||||||
const currencyOptions = [
|
const currencyOptions = [
|
||||||
{ code: 'usd', name: 'USD' },
|
{ code: 'usd', name: 'USD' },
|
||||||
{ code: 'eur', name: 'EUR' },
|
{ code: 'eur', name: 'EUR' },
|
||||||
|
@ -258,7 +260,7 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = (
|
||||||
{ code: 'cny', name: 'CNY' },
|
{ code: 'cny', name: 'CNY' },
|
||||||
{ code: 'inr', name: 'INR' },
|
{ code: 'inr', name: 'INR' },
|
||||||
];
|
];
|
||||||
|
//#region date settings
|
||||||
const dateFormatOptions = [
|
const dateFormatOptions = [
|
||||||
{ value: 'mm/dd/yyyy', label: 'MM/DD/YYYY' },
|
{ value: 'mm/dd/yyyy', label: 'MM/DD/YYYY' },
|
||||||
{ value: 'dd/mm/yyyy', label: 'DD/MM/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: 'Metric', label: 'Metric' },
|
||||||
{ value: 'Imperial', label: 'Imperial' },
|
{ value: 'Imperial', label: 'Imperial' },
|
||||||
];
|
];
|
||||||
|
//#region text settings
|
||||||
const fontOptions = [
|
const fontOptions = [
|
||||||
{ value: "'Poppins', sans-serif", label: 'Poppins' },
|
{ value: "'Poppins', sans-serif", label: 'Poppins' },
|
||||||
{ value: "'Inconsolata', monospace", label: 'Inconsolata' },
|
{ 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' },
|
{ value: "'Zilla Slab Highlight', serif", label: 'Zilla Slab Highlight' },
|
||||||
];
|
];
|
||||||
|
|
||||||
//#region Start of the code
|
//#region Function
|
||||||
const handleLogout = () => {
|
const handleLogout = () => {
|
||||||
localStorage.clear();
|
localStorage.clear();
|
||||||
alert('Successfully logged out!');
|
alert('Successfully logged out!');
|
||||||
|
|
Loading…
Reference in a new issue