Skip to content

Commit

Permalink
fix: tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
tuanddd committed Feb 20, 2024
1 parent 45ff982 commit 3dcba26
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
18 changes: 18 additions & 0 deletions apps/mochi-web/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ import {
LinkSquircledSolid,
WalletAddSolid,
ScanLine,
MoonLine,
SunLine,
} from '@mochi-ui/icons'
import { useTheme } from '~context/theme'
import NotificationList from '~cpn/NotificationList'
import clsx from 'clsx'
import { DISCORD_LINK, GITHUB_LINK, TELEGRAM_LINK } from '~envs'
Expand Down Expand Up @@ -95,6 +98,7 @@ export const Header = () => {
const { profile, isLoggedIn, socials } = useLoginWidget()
const { setIsNavOpen } = useIsNavOpenStore()
const { data: changelogData } = useFetchChangelogLatest()
const { theme, setTheme } = useTheme()

const redirectToTipWidget = useCallback(async () => {
if (pathname !== ROUTES.HOME) {
Expand Down Expand Up @@ -467,6 +471,20 @@ export const Header = () => {
>
<div className="w-full h-6 bg-[#eeedec]" />
</div>,
<IconButton
label="dark/light mode toggle button"
key="dark/light mode toggle"
variant="outline"
color="neutral"
className="!p-1.5"
onClick={() => setTheme(theme === 'light' ? 'dark' : 'light')}
>
{theme === 'light' ? (
<MoonLine className="w-5 h-5" />
) : (
<SunLine className="w-5 h-5" />
)}
</IconButton>,
<LoginPopover key="desktop-login-popover" />,
]),
]
Expand Down
4 changes: 4 additions & 0 deletions packages/icons/src/svg/line/moon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions packages/icons/src/svg/line/sun.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3dcba26

Please sign in to comment.