Compare commits
No commits in common. "1b0daef0885282635c2476b49b68ac5f160c36ff" and "8ccf86bcb7daab99c9ba6332e4bb664c5cb5f8a4" have entirely different histories.
1b0daef088
...
8ccf86bcb7
1 changed files with 6 additions and 27 deletions
|
@ -1,4 +1,3 @@
|
||||||
//#region imports
|
|
||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { applyTheme } from './theme';
|
import { applyTheme } from './theme';
|
||||||
import { exportSettings, importSettings } from './settingUtils'; // Import utility functions
|
import { exportSettings, importSettings } from './settingUtils'; // Import utility functions
|
||||||
|
@ -35,8 +34,6 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = (
|
||||||
return false; // Default to false if item is null or empty
|
return false; // Default to false if item is null or empty
|
||||||
};
|
};
|
||||||
|
|
||||||
//#region variables
|
|
||||||
|
|
||||||
// Active section
|
// Active section
|
||||||
const [activeSection, setActiveSection] = useState(() => localStorage.getItem('activeSection') || 'general');
|
const [activeSection, setActiveSection] = useState(() => localStorage.getItem('activeSection') || 'general');
|
||||||
|
|
||||||
|
@ -290,7 +287,6 @@ 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
|
|
||||||
const handleLogout = () => {
|
const handleLogout = () => {
|
||||||
localStorage.clear();
|
localStorage.clear();
|
||||||
alert('Successfully logged out!');
|
alert('Successfully logged out!');
|
||||||
|
@ -383,11 +379,10 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = (
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//#region rendered content
|
|
||||||
// Render settings content based on the active section
|
// Render settings content based on the active section
|
||||||
const renderSettingsContent = () => {
|
const renderSettingsContent = () => {
|
||||||
switch (activeSection) {
|
switch (activeSection) {
|
||||||
//#region general
|
|
||||||
case 'general':
|
case 'general':
|
||||||
return (
|
return (
|
||||||
<div className="settings-section">
|
<div className="settings-section">
|
||||||
|
@ -444,7 +439,6 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = (
|
||||||
);
|
);
|
||||||
|
|
||||||
case 'privacy':
|
case 'privacy':
|
||||||
//#region privacy
|
|
||||||
return (
|
return (
|
||||||
<div className="settings-section">
|
<div className="settings-section">
|
||||||
<h2>Privacy Settings</h2>
|
<h2>Privacy Settings</h2>
|
||||||
|
@ -471,8 +465,6 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = (
|
||||||
|
|
||||||
|
|
||||||
case 'theme':
|
case 'theme':
|
||||||
//#region theme
|
|
||||||
//#region Basic
|
|
||||||
return (
|
return (
|
||||||
<div className="settings-section">
|
<div className="settings-section">
|
||||||
<h2>Theme Settings</h2>
|
<h2>Theme Settings</h2>
|
||||||
|
@ -481,6 +473,7 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = (
|
||||||
selectedTheme={selectedTheme}
|
selectedTheme={selectedTheme}
|
||||||
setSelectedTheme={setSelectedTheme}
|
setSelectedTheme={setSelectedTheme}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{selectedTheme === 'BASIC-CUSTOM' && (
|
{selectedTheme === 'BASIC-CUSTOM' && (
|
||||||
<>
|
<>
|
||||||
<h3>Basic Colors</h3>
|
<h3>Basic Colors</h3>
|
||||||
|
@ -515,19 +508,6 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = (
|
||||||
setValue={setBasicTextColor}
|
setValue={setBasicTextColor}
|
||||||
cssVariable=""
|
cssVariable=""
|
||||||
/>
|
/>
|
||||||
<DropdownSetting
|
|
||||||
label="Font Family"
|
|
||||||
value={fontFamily}
|
|
||||||
setValue={(newFont) => {
|
|
||||||
setFontFamily(newFont);
|
|
||||||
document.documentElement.style.setProperty('--font-family', newFont);
|
|
||||||
}}
|
|
||||||
options={fontOptions}
|
|
||||||
/>
|
|
||||||
<FontSizeSetting
|
|
||||||
fontSize={fontSize}
|
|
||||||
setFontSize={setFontSize}
|
|
||||||
/>
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
@ -563,7 +543,7 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = (
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
//#region custom --> foss
|
|
||||||
case 'foss':
|
case 'foss':
|
||||||
return (
|
return (
|
||||||
<div className="settings-section">
|
<div className="settings-section">
|
||||||
|
@ -576,7 +556,7 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = (
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
//#region account
|
|
||||||
case 'account':
|
case 'account':
|
||||||
return (
|
return (
|
||||||
<div className="settings-section">
|
<div className="settings-section">
|
||||||
|
@ -619,7 +599,7 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = (
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
//#region api
|
|
||||||
case 'api':
|
case 'api':
|
||||||
return (
|
return (
|
||||||
<div className="settings-section">
|
<div className="settings-section">
|
||||||
|
@ -673,7 +653,7 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = (
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
//#region import export
|
|
||||||
case 'im/export':
|
case 'im/export':
|
||||||
return (
|
return (
|
||||||
<div className="settings-section">
|
<div className="settings-section">
|
||||||
|
@ -727,7 +707,6 @@ const Settings: React.FC<{ closeSettings: () => void; accountName: string }> = (
|
||||||
URL.revokeObjectURL(url); // Clean up the URL object
|
URL.revokeObjectURL(url); // Clean up the URL object
|
||||||
};
|
};
|
||||||
|
|
||||||
//#region overall export
|
|
||||||
return (
|
return (
|
||||||
<div className="popup-overlay">
|
<div className="popup-overlay">
|
||||||
<div className="settings-content">
|
<div className="settings-content">
|
||||||
|
|
Loading…
Reference in a new issue