Skip to content

Commit

Permalink
feat: finalise theme settings modal
Browse files Browse the repository at this point in the history
  • Loading branch information
ZakMooney committed Nov 1, 2024
1 parent 4aff1da commit 8d6c2aa
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/components/ui/ThemeSettings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@ import {
useThemeSettingsOpenStore,
useLocalThemeStore,
useLocalThemeModePrefStore,
useLocalThemeModeStore,
} from "../../store/Store";

import {
SunIcon,
MoonIcon,
} from '@heroicons/react/24/solid';

import Modal from "./Modal";
import Button from "./Button";
import Typography from "./Typography";
import Select from "./Select";

Expand Down Expand Up @@ -43,6 +50,7 @@ const ThemeSettings = () => {

const { localThemeStore, setLocalThemeStore } = useLocalThemeStore();
const { localThemeModePrefStore, setLocalThemeModePrefStore } = useLocalThemeModePrefStore();
const { localThemeModeStore } = useLocalThemeModeStore();

const chosenTheme = localThemeStore;

Expand All @@ -55,6 +63,8 @@ const ThemeSettings = () => {
setLocalThemeModePrefStore(e.target.value)
}

const isLight = localThemeModeStore && localThemeModeStore.includes('light');

return (
<>
<Modal
Expand All @@ -63,6 +73,17 @@ const ThemeSettings = () => {
setThemeSettingsOpenStore(false);
}}
>
<Typography variant="h2" className="card-title">
{isLight ? (
<SunIcon className="w-6 h-6"/>
) : (
<MoonIcon className="w-6 h-6"/>
)}
Theme Settings
</Typography>
<Typography variant="p" className="mb-2">
Select your preferred Theme, and Dark/Light mode settings below.
</Typography>
<div>
<Typography
variant="p"
Expand Down Expand Up @@ -99,6 +120,17 @@ const ThemeSettings = () => {
>
</Select>
</div>
<div className="card-actions pt-4 flex-col-reverse lg:flex-row justify-end">
<Button
className="w-full lg:w-auto"
variant="outline"
onClick={() => {
setThemeSettingsOpenStore(false);
}}
>
Close
</Button>
</div>
</Modal>
</>
)
Expand Down

0 comments on commit 8d6c2aa

Please sign in to comment.