Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: tweak #773

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Loading