From 3451233927973eef16b232c92aca3e7fc5204bf5 Mon Sep 17 00:00:00 2001 From: Ansh Nanda Date: Fri, 5 May 2023 15:16:29 -0700 Subject: [PATCH] change icon on dark mode press --- src/lib/icons.tsx | 27 +++++++++++++++++++++++++++ src/view/shell/Drawer.tsx | 19 ++++++++++++++----- 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/src/lib/icons.tsx b/src/lib/icons.tsx index 4cb491e467..adf8b7903c 100644 --- a/src/lib/icons.tsx +++ b/src/lib/icons.tsx @@ -320,6 +320,33 @@ export function MoonIcon({ ) } +export function SunIcon({ + style, + size, + strokeWidth = 1.5, +}: { + style?: StyleProp + size?: string | number + strokeWidth?: number +}) { + return ( + + + + ) +} + // Copyright (c) 2020 Refactoring UI Inc. // https://github.com/tailwindlabs/heroicons/blob/master/LICENSE export function UserIcon({ diff --git a/src/view/shell/Drawer.tsx b/src/view/shell/Drawer.tsx index 1b8983e83a..1812e4d3aa 100644 --- a/src/view/shell/Drawer.tsx +++ b/src/view/shell/Drawer.tsx @@ -28,6 +28,7 @@ import { MagnifyingGlassIcon2Solid, MoonIcon, UserIconSolid, + SunIcon, } from 'lib/icons' import {UserAvatar} from 'view/com/util/UserAvatar' import {Text} from 'view/com/util/text/Text' @@ -273,11 +274,19 @@ export const DrawerContent = observer(() => { ? pal.btn : styles.footerBtnDarkMode, ]}> - } - strokeWidth={2} - /> + {store.shell.darkMode ? ( + } + strokeWidth={2} + /> + ) : ( + } + strokeWidth={2} + /> + )} )}