@@ -33,7 +33,8 @@ import { NotificationsMenu } from '@/views/menus/NotificationsMenu';
3333
3434import { getOnboardingState } from '@/state/accountSelectors' ;
3535import { useAppDispatch , useAppSelector } from '@/state/appTypes' ;
36- import { getHasSeenLaunchIncentives } from '@/state/appUiConfigsSelectors' ;
36+ import { AppTheme , setAppThemeSetting } from '@/state/appUiConfigs' ;
37+ import { getAppTheme , getHasSeenLaunchIncentives } from '@/state/appUiConfigsSelectors' ;
3738import { openDialog } from '@/state/dialogs' ;
3839
3940import { isTruthy } from '@/lib/isTruthy' ;
@@ -46,9 +47,15 @@ export const HeaderDesktop = () => {
4647 const onboardingState = useAppSelector ( getOnboardingState ) ;
4748 const { complianceState } = useComplianceState ( ) ;
4849 const isSpotEnabled = useEnableSpot ( ) ;
50+ const currentTheme = useAppSelector ( getAppTheme ) ;
4951
5052 const hasSeenLaunchIncentives = useAppSelector ( getHasSeenLaunchIncentives ) ;
5153
54+ const handleThemeToggle = ( ) => {
55+ const newTheme = currentTheme === AppTheme . Dark ? AppTheme . Light : AppTheme . Dark ;
56+ dispatch ( setAppThemeSetting ( newTheme ) ) ;
57+ } ;
58+
5259 const navItems = [
5360 {
5461 group : 'navigation' ,
@@ -68,16 +75,11 @@ export const HeaderDesktop = () => {
6875 label : stringGetter ( { key : STRING_KEYS . MARKETS } ) ,
6976 href : AppRoute . Markets ,
7077 } ,
71- {
78+ onboardingState === OnboardingState . AccountConnected && {
7279 value : 'PORTFOLIO' ,
7380 label : stringGetter ( { key : STRING_KEYS . PORTFOLIO } ) ,
7481 href : AppRoute . Portfolio ,
7582 } ,
76- {
77- value : 'VAULT' ,
78- label : stringGetter ( { key : STRING_KEYS . MEGAVAULT } ) ,
79- href : AppRoute . Vault ,
80- } ,
8183 {
8284 value : 'REWARDS' ,
8385 label : stringGetter ( { key : STRING_KEYS . REWARDS } ) ,
@@ -90,6 +92,12 @@ export const HeaderDesktop = () => {
9092 value : 'MORE' ,
9193 label : stringGetter ( { key : STRING_KEYS . MORE } ) ,
9294 subitems : [
95+ {
96+ value : 'VAULT' ,
97+ slotBefore : < Icon iconName = { IconName . Bank } /> ,
98+ label : stringGetter ( { key : STRING_KEYS . MEGAVAULT } ) ,
99+ href : AppRoute . Vault ,
100+ } ,
93101 {
94102 value : 'DOCUMENTATION' ,
95103 slotBefore : < Icon iconName = { IconName . Terminal } /> ,
@@ -172,22 +180,26 @@ export const HeaderDesktop = () => {
172180 < MobileDownloadLinks />
173181 ) }
174182
175- < $IconButton
176- shape = { ButtonShape . Rectangle }
177- iconName = { IconName . HelpCircle }
178- onClick = { ( ) => dispatch ( openDialog ( DialogTypes . Help ( ) ) ) }
179- />
183+ { onboardingState === OnboardingState . AccountConnected && (
184+ < NotificationsMenu
185+ slotTrigger = {
186+ < $IconButton
187+ shape = { ButtonShape . Rectangle }
188+ iconComponent = { BellStrokeIcon as React . ElementType }
189+ />
190+ }
191+ />
192+ ) }
180193
181- < NotificationsMenu
182- slotTrigger = {
183- < $IconButton
184- shape = { ButtonShape . Rectangle }
185- iconComponent = { BellStrokeIcon as React . ElementType }
186- />
187- }
194+ < $ThemeToggleButton
195+ shape = { ButtonShape . Rectangle }
196+ iconName = { currentTheme === AppTheme . Dark ? IconName . Sun : IconName . Moon }
197+ onClick = { handleThemeToggle }
188198 />
189199
190- < AccountMenu />
200+ < $AccountMenuWrapper >
201+ < AccountMenu />
202+ </ $AccountMenuWrapper >
191203 </ $NavAfter >
192204 </ $Header >
193205 ) ;
@@ -267,7 +279,7 @@ const $LogoLink = styled(Link)`
267279 > div {
268280 margin: auto;
269281 width: auto;
270- height: 69 %;
282+ height: 85 %;
271283 }
272284` ;
273285
@@ -287,10 +299,17 @@ const $NavAfter = styled.div`
287299const $IconButton = styled ( IconButton ) < { size ?: string } > `
288300 ${ headerMixins . button }
289301 --button-border: none;
290- --button-icon-size: 1rem ;
302+ --button-icon-size: 1.15rem ;
291303 --button-padding: 0 0.5em;
292304` ;
293305
306+ const $ThemeToggleButton = styled ( IconButton ) `
307+ ${ headerMixins . button }
308+ --button-border: none;
309+ --button-icon-size: 1.25em;
310+ --button-padding: 0.33rem 0.5rem;
311+ ` ;
312+
294313const $LanguageSelector = styled ( LanguageSelector ) `
295314 ${ headerMixins . dropdownTrigger }
296315 --trigger-padding: 0.33rem 0.5rem;
@@ -304,3 +323,13 @@ const $DepositButton = styled(Button)`
304323 color: var(--color-white) !important;
305324 }
306325` ;
326+
327+ const $AccountMenuWrapper = styled . div `
328+ display: flex;
329+ align-items: center;
330+
331+ > * {
332+ transform: scale(1.15);
333+ transform-origin: center;
334+ }
335+ ` ;
0 commit comments