Commit 58377952 authored by tom's avatar tom

hide network menu and profile menu if related envs are not provided

parent 21528c82
......@@ -40,7 +40,7 @@ const Home = () => {
pl={ 4 }
>
<ColorModeToggler trackBg="whiteAlpha.500"/>
<ProfileMenuDesktop/>
{ appConfig.isAccountSupported && <ProfileMenuDesktop/> }
</Flex>
</Flex>
<LightMode>
......
import { Icon, Box, Flex, Drawer, DrawerOverlay, DrawerContent, DrawerBody, useColorModeValue, useDisclosure } from '@chakra-ui/react';
import React from 'react';
import appConfig from 'configs/app/config';
import burgerIcon from 'icons/burger.svg';
import testnetIcon from 'icons/testnet.svg';
import NavigationMobile from 'ui/snippets/navigation/NavigationMobile';
......@@ -45,11 +46,13 @@ const Burger = () => {
<Icon as={ testnetIcon } h="14px" w="auto" color="red.400" alignSelf="flex-start"/>
<Flex alignItems="center" justifyContent="space-between">
<NetworkLogo onClick={ handleNetworkLogoClick }/>
<NetworkMenuButton
isMobile
isActive={ isNetworkMenuOpened }
onClick={ handleNetworkMenuButtonClick }
/>
{ appConfig.featuredNetworks.length > 0 ? (
<NetworkMenuButton
isMobile
isActive={ isNetworkMenuOpened }
onClick={ handleNetworkMenuButtonClick }
/>
) : <Box boxSize={ 9 }/> }
</Flex>
{ isNetworkMenuOpened ? <NetworkMenuContentMobile/> : <NavigationMobile/> }
</DrawerBody>
......
import { HStack, Box, Flex, useColorModeValue } from '@chakra-ui/react';
import React from 'react';
import appConfig from 'configs/app/config';
import { useScrollDirection } from 'lib/contexts/scrollDirection';
import IndexingAlert from 'ui/home/IndexingAlert';
import NetworkLogo from 'ui/snippets/networkMenu/NetworkLogo';
......@@ -43,7 +44,7 @@ const Header = ({ isHomePage, renderSearchBar }: Props) => {
>
<Burger/>
<NetworkLogo/>
<ProfileMenuMobile/>
{ appConfig.isAccountSupported ? <ProfileMenuMobile/> : <Box boxSize={ 10 }/> }
</Flex>
{ !isHomePage && searchBar }
</Box>
......@@ -66,7 +67,7 @@ const Header = ({ isHomePage, renderSearchBar }: Props) => {
{ searchBar }
</Box>
<ColorModeToggler/>
<ProfileMenuDesktop/>
{ appConfig.isAccountSupported && <ProfileMenuDesktop/> }
</HStack>
) }
</Box>
......
......@@ -77,7 +77,7 @@ const NavigationDesktop = () => {
transitionTimingFunction="ease"
>
<NetworkLogo isCollapsed={ isCollapsed }/>
<NetworkMenu isCollapsed={ isCollapsed }/>
{ appConfig.featuredNetworks.length > 0 && <NetworkMenu isCollapsed={ isCollapsed }/> }
</Box>
<Box as="nav" mt={ 8 } w="100%">
<VStack as="ul" spacing="1" alignItems="flex-start">
......
......@@ -67,7 +67,7 @@ const NavigationMobile = () => {
}) }
</VStack>
</Box>
{ isAuth && (
{ hasAccount && (
<Box
as="nav"
mt={ 6 }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment