Skip to content

Commit

Permalink
Merge pull request #1199 from near/single-menu
Browse files Browse the repository at this point in the history
feat: simplified menu
  • Loading branch information
gagdiez authored Jun 10, 2024
2 parents 29acf52 + 8147fa6 commit 5f0012d
Show file tree
Hide file tree
Showing 10 changed files with 377 additions and 182 deletions.
2 changes: 1 addition & 1 deletion src/components/layouts/DefaultLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function DefaultLayout({ children }: Props) {
{sidebarLayoutEnabled ? <SidebarNavigation /> : <MarketingNavigation />}

<Content>
{sidebarLayoutEnabled && <LargeScreenHeader />}
{/* {sidebarLayoutEnabled && <LargeScreenHeader />} */}

<BosLoaderBanner />

Expand Down
55 changes: 0 additions & 55 deletions src/components/sidebar-navigation/DiscoverDrawer.tsx

This file was deleted.

34 changes: 34 additions & 0 deletions src/components/sidebar-navigation/LargeScreenNameDropdown.tsx
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>
);
};
75 changes: 0 additions & 75 deletions src/components/sidebar-navigation/MarketingDrawer.tsx

This file was deleted.

Loading

0 comments on commit 5f0012d

Please sign in to comment.