-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
π Add dark and light support (#133)
* Add dark and light support * Add theme selector on account page * Add theme selector * π Fix bug with floating numbers on exact split calculator (#135) Fix bug with floating numbers on exact split calculator * Update default theme * Fix the theme color on light mode * π Order by expense created date in the groups list (#139) Order by expense created date in the groups list * π Redirect to groupexpense or expense in activity list based on groupId (#140) Redirect to groupexpense or expense in activity list based on groupId * π Add group created date and first expense date (#141) * Add group created date and first expense date * Fixup * fix date format error * fix deleted expense included in total stats --------- Co-authored-by: KMKoushik <koushikmohan1996@gmail.com>
- Loading branch information
1 parent
464cc4f
commit 4071ba5
Showing
19 changed files
with
7,399 additions
and
5,567 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import React from 'react'; | ||
import { Command, CommandGroup, CommandItem } from '../ui/command'; | ||
import { AppDrawer } from '../ui/drawer'; | ||
import { Check, ChevronRight, Moon } from 'lucide-react'; | ||
import { cn } from '~/lib/utils'; | ||
import { Button } from '../ui/button'; | ||
import { useTheme } from 'next-themes'; | ||
|
||
const supportedThemes = { | ||
dark: 'Dark', | ||
light: 'Light', | ||
system: 'System prefer', | ||
}; | ||
|
||
export const ThemeSelect = () => { | ||
const [open, setOpen] = React.useState(false); | ||
const { theme, setTheme } = useTheme(); | ||
|
||
const onSelect = async (currentValue: string) => { | ||
setTheme(currentValue); | ||
|
||
setOpen(false); | ||
}; | ||
|
||
return ( | ||
<AppDrawer | ||
trigger={ | ||
<Button | ||
variant="ghost" | ||
className="text-md w-full justify-between px-0 hover:text-foreground/80" | ||
> | ||
<div className="flex items-center gap-4"> | ||
<Moon className="h-5 w-5 text-violet-500" /> | ||
<p>Theme</p> | ||
</div> | ||
<ChevronRight className="h-6 w-6 text-gray-500" /> | ||
</Button> | ||
} | ||
onTriggerClick={() => setOpen(true)} | ||
title={'Select theme'} | ||
className="h-[70vh]" | ||
shouldCloseOnAction | ||
open={open} | ||
onOpenChange={(openVal) => { | ||
if (openVal !== open) setOpen(openVal); | ||
}} | ||
> | ||
<div className=""> | ||
<Command className="h-[50vh]"> | ||
<CommandGroup className="h-full overflow-auto"> | ||
{Object.keys(supportedThemes).map((framework, index) => ( | ||
<CommandItem | ||
key={framework} | ||
value={framework} | ||
onSelect={(currentValue) => onSelect(currentValue)} | ||
> | ||
<Check | ||
className={cn('mr-2 h-4 w-4', framework === theme ? 'opacity-100' : 'opacity-0')} | ||
/> | ||
<div className="flex gap-2"> | ||
<p>{Object.values(supportedThemes)[index]}</p> | ||
</div> | ||
</CommandItem> | ||
))} | ||
</CommandGroup> | ||
</Command> | ||
</div> | ||
</AppDrawer> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.