Skip to content

Commit

Permalink
checking the next try
Browse files Browse the repository at this point in the history
  • Loading branch information
swordfest committed Feb 26, 2024
1 parent 42891d1 commit 4404484
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions components/iconMode.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { IconDeviceImac, IconMoon, IconSun } from "@tabler/icons-react";

export default function Icon (props: {name: String, rotate: boolean}){
switch (props.name) {
export default function Icon (props: {name: String | undefined, rotate: boolean}){
props.name ?? 'system'
switch (props.name!) {
case 'light': {
return <IconSun className={`stroke-[#303030] dark:stroke-[#cfcfcf]`} />
}
Expand Down
2 changes: 1 addition & 1 deletion components/toogleDarkMode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function ToggleDarkMode() {
<div>
<div title='Theme Toggler' ref={ref} onClick={() => handleMenu()} id="toggle" className="custom-toggle overflow-visible relative w-auto h-auto cursor-pointer">
<div className={("toggle-dark dark:hover:bg-[#1b1b1b] dark:active:bg-[#1b1b1b] w-12 h-12 hover:bg-[#EBEBEB] active:bg-[#D7D7D7] transition-colors rounded-md flex items-center justify-center cursor-pointer ") + (open ? 'bg-[#EBEBEB] dark:bg-[#1b1b1b]' : '')}>
<Icon name={theme?.toString()!} rotate={false} />
<Icon name={theme?.toString()} rotate={false} />
</div>
<div className={('absolute w-36 h-auto top-[72px] right-0 xl:left-0 bg-white dark:bg-[#212121] dark:text-[#cfcfcf] rounded-md shadow-lg flex flex-col mx-auto p-2 gap-2 border border-[#e0e0e0] dark:border-[#303030] ') + (open ? '' : 'hidden')}>
<button onClick={() => handleClick('light')} className={('item-theme w-32 h-10 rounded-md px-2 flex items-center justify-start gap-2 dark:hover:bg-[#1b1b1b] dark:active:bg-[#1b1b1b] hover:bg-[#EBEBEB] active:bg-[#D7D7D7] transition-colors ') + (theme === 'light' && 'bg-[#EBEBEB] dark:bg-[#1b1b1b]')}>
Expand Down

0 comments on commit 4404484

Please sign in to comment.