-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create header components for mobile and desktop view
- Loading branch information
Showing
3 changed files
with
113 additions
and
66 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from 'react'; | ||
|
||
import { HStack } from '@chakra-ui/react'; | ||
import { Account } from '@components/account/account'; | ||
import { CompanyWebsiteButton } from '@components/company-website-button/company-website-button'; | ||
import { NetworkBox } from '@components/network/network'; | ||
|
||
import { HeaderLayout } from './header.layout'; | ||
import { NavigationTabs } from './tabs'; | ||
|
||
interface DesktopHeaderProps { | ||
isNetworkMenuOpen: boolean; | ||
setIsNetworkMenuOpen: (isOpen: boolean) => void; | ||
handleTabClick: (route: string) => void; | ||
} | ||
|
||
const DesktopHeader: React.FC<DesktopHeaderProps> = ({ | ||
isNetworkMenuOpen, | ||
setIsNetworkMenuOpen, | ||
handleTabClick, | ||
}) => { | ||
return ( | ||
<HeaderLayout> | ||
<HStack justifyContent={'flex-start'} w={'100%'} gap={'50px'}> | ||
<CompanyWebsiteButton /> | ||
<NavigationTabs activeTab={location.pathname} handleTabClick={handleTabClick} /> | ||
</HStack> | ||
<HStack> | ||
<> | ||
<NetworkBox isMenuOpen={isNetworkMenuOpen} setIsMenuOpen={setIsNetworkMenuOpen} /> | ||
<Account /> | ||
</> | ||
</HStack> | ||
</HeaderLayout> | ||
); | ||
}; | ||
|
||
export default DesktopHeader; |
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,58 @@ | ||
import React from 'react'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
import { HamburgerIcon } from '@chakra-ui/icons'; | ||
import { HStack, IconButton, Menu, MenuButton, MenuItem, MenuList } from '@chakra-ui/react'; | ||
import { Account } from '@components/account/account'; | ||
import { CompanyWebsiteButton } from '@components/company-website-button/company-website-button'; | ||
import { NetworkBox } from '@components/network/network'; | ||
|
||
import { HeaderLayout } from './header.layout'; | ||
|
||
interface MobileHeaderProps { | ||
isNetworkMenuOpen: boolean; | ||
setIsNetworkMenuOpen: (isOpen: boolean) => void; | ||
isActiveTabs: boolean; | ||
} | ||
|
||
const MobileHeader: React.FC<MobileHeaderProps> = ({ | ||
isNetworkMenuOpen, | ||
setIsNetworkMenuOpen, | ||
isActiveTabs, | ||
}) => { | ||
const navigate = useNavigate(); | ||
return ( | ||
<HeaderLayout> | ||
<HStack justifyContent={'space-between'} w={'100%'} gap={'0px'}> | ||
<CompanyWebsiteButton /> | ||
<HStack> | ||
<NetworkBox isMenuOpen={isNetworkMenuOpen} setIsMenuOpen={setIsNetworkMenuOpen} /> | ||
<Account /> | ||
<Menu> | ||
<MenuButton | ||
as={IconButton} | ||
aria-label="Options" | ||
icon={<HamburgerIcon />} | ||
height={'40px'} | ||
width={'40px'} | ||
/> | ||
<MenuList> | ||
<MenuItem onClick={() => navigate('/')}>Points</MenuItem> | ||
<MenuItem onClick={() => navigate('/proof-of-reserve')}>Proof of Reserve</MenuItem> | ||
{isActiveTabs && ( | ||
<> | ||
<MenuItem onClick={() => navigate('/mint-withdraw')}> | ||
Mint/Withdraw dlcBTC | ||
</MenuItem> | ||
<MenuItem onClick={() => navigate('/my-vaults')}>My Vaults</MenuItem> | ||
</> | ||
)} | ||
</MenuList> | ||
</Menu> | ||
</HStack> | ||
</HStack> | ||
</HeaderLayout> | ||
); | ||
}; | ||
|
||
export default MobileHeader; |
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