mirror of
https://github.com/abusoww/tuxmate.git
synced 2026-04-26 18:35:12 +02:00
feat: Enhance UI with system theme, refined headers, and new layout
- layout: Auto-detect system theme on first visit - header: Refined layout (centered, uppercase subtitle, inline help) - categories: Compact 'Soft Pill' design with improved focus state - data: Reorganized Zellij to CLI Tools - lint: Fixed various linting issues
This commit is contained in:
@@ -54,6 +54,7 @@ export function useLinuxInit(): UseLinuxInitReturn {
|
||||
const savedHelper = localStorage.getItem(STORAGE_KEY_HELPER) as 'yay' | 'paru' | null;
|
||||
|
||||
if (savedDistro && distros.some(d => d.id === savedDistro)) {
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||
setSelectedDistroState(savedDistro);
|
||||
}
|
||||
|
||||
@@ -76,7 +77,7 @@ export function useLinuxInit(): UseLinuxInitReturn {
|
||||
if (savedHelper === 'paru') {
|
||||
setSelectedHelper('paru');
|
||||
}
|
||||
} catch (e) {
|
||||
} catch {
|
||||
// Ignore localStorage errors
|
||||
}
|
||||
setHydrated(true);
|
||||
@@ -90,7 +91,7 @@ export function useLinuxInit(): UseLinuxInitReturn {
|
||||
localStorage.setItem(STORAGE_KEY_APPS, JSON.stringify([...selectedApps]));
|
||||
localStorage.setItem(STORAGE_KEY_YAY, hasYayInstalled.toString());
|
||||
localStorage.setItem(STORAGE_KEY_HELPER, selectedHelper);
|
||||
} catch (e) {
|
||||
} catch {
|
||||
// Ignore localStorage errors
|
||||
}
|
||||
}, [selectedDistro, selectedApps, hasYayInstalled, selectedHelper, hydrated]);
|
||||
|
||||
@@ -22,12 +22,7 @@ export function ThemeProvider({ children }: { children: React.ReactNode }) {
|
||||
const [hydrated, setHydrated] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
// On mount, sync with localStorage and mark as hydrated
|
||||
const saved = localStorage.getItem('theme') as Theme | null
|
||||
if (saved && saved !== theme) {
|
||||
setTheme(saved)
|
||||
document.documentElement.classList.toggle('light', saved === 'light')
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||
setHydrated(true)
|
||||
}, [])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user