udpate for coming soon

This commit is contained in:
diyaa
2026-03-13 03:45:13 +01:00
parent 243a182d33
commit cdf83cd466
32 changed files with 907 additions and 143 deletions
+9 -3
View File
@@ -6,11 +6,17 @@ type Theme = "dark" | "light";
const STORAGE_KEY = "theme";
type ThemeToggleProps = {
label: string;
lightLabel: string;
darkLabel: string;
};
function isTheme(value: string | null): value is Theme {
return value === "dark" || value === "light";
}
export default function ThemeToggle() {
export default function ThemeToggle({ label, lightLabel, darkLabel }: ThemeToggleProps) {
const [theme, setTheme] = useState<Theme>("dark");
useEffect(() => {
@@ -34,9 +40,9 @@ export default function ThemeToggle() {
type="button"
onClick={handleToggle}
className="theme-toggle"
aria-label={`Switch to ${theme === "dark" ? "light" : "dark"} mode`}
aria-label={`${label}: ${theme === "dark" ? lightLabel : darkLabel}`}
>
<span className="theme-toggle-label">{theme === "dark" ? "Light" : "Dark"}</span>
<span className="theme-toggle-label">{theme === "dark" ? lightLabel : darkLabel}</span>
</button>
);
}