Skip to content

Commit

Permalink
chore: use classes for displaying icon
Browse files Browse the repository at this point in the history
prevent layout 'glitch' effect
  • Loading branch information
enjidev committed Jan 8, 2023
1 parent 771a441 commit e52650f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions apps/enji.dev/src/components/navigations/NavIconTheme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,16 @@ function NavIconTheme() {
'hover:bg-slate-300/70 sm:ml-0',
'dark:bg-slate-800/50 dark:text-slate-100 dark:hover:bg-slate-700/50'
)}
aria-label={theme === 'dark' ? 'Light Mode' : 'Dark Mode'}
title={theme === 'dark' ? 'Light Mode' : 'Dark Mode'}
aria-label={theme === 'dark' ? 'Use Light Mode' : 'Use Dark Mode'}
title={theme === 'dark' ? 'Use Light Mode' : 'Use Dark Mode'}
onClick={handleThemeChange}
>
{theme === 'dark' ? (
<div className={clsx('hidden', 'dark:block')}>
<LightIcon className={clsx('h-5 w-5')} />
) : (
</div>
<div className={clsx('dark:hidden')}>
<DarkIcon className={clsx('h-5 w-5')} />
)}
</div>
</button>
</>
);
Expand Down

1 comment on commit e52650f

@vercel
Copy link

@vercel vercel bot commented on e52650f Jan 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

enjidev – ./

enjidev-git-main-enjidev.vercel.app
enjidev-enjidev.vercel.app
enjidev.vercel.app
enji.dev
www.enji.dev

Please sign in to comment.