-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1199 from near/single-menu
feat: simplified menu
- Loading branch information
Showing
10 changed files
with
377 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
src/components/sidebar-navigation/LargeScreenNameDropdown.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { useCallback } from 'react'; | ||
|
||
import { useBosComponents } from '@/hooks/useBosComponents'; | ||
import { useAuthStore } from '@/stores/auth'; | ||
import { useVmStore } from '@/stores/vm'; | ||
|
||
import { VmComponent } from '../vm/VmComponent'; | ||
import * as S from './styles'; | ||
|
||
export const LargeScreenNameDropdown = () => { | ||
const components = useBosComponents(); | ||
const near = useVmStore((store) => store.near); | ||
const availableStorage = useAuthStore((store) => store.availableStorage); | ||
const availableStorageDisplay = availableStorage?.gte(10) ? availableStorage.div(1000).toFixed(2) : '0'; | ||
const logOut = useAuthStore((store) => store.logOut); | ||
|
||
const withdrawTokens = useCallback(async () => { | ||
if (!near) return; | ||
await near.contract.storage_withdraw({}, undefined, '1'); | ||
}, [near]); | ||
|
||
return ( | ||
<S.LargeScreenHeaderNameWrapper> | ||
<VmComponent | ||
src={components.navigation.nameDropdown} | ||
props={{ | ||
availableStorage: availableStorageDisplay, | ||
withdrawTokens, | ||
logOut, | ||
}} | ||
/> | ||
</S.LargeScreenHeaderNameWrapper> | ||
); | ||
}; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.