From e0e022022b1c2465648c464484a0e44c681fbcb9 Mon Sep 17 00:00:00 2001 From: Max Alekseenko Date: Tue, 12 Dec 2023 15:25:58 +0100 Subject: [PATCH] fix header after merge --- ui/shared/layout/LayoutApp.tsx | 6 +- ui/snippets/header/Header.tsx | 84 ---------------------------- ui/snippets/header/HeaderDesktop.tsx | 18 +++++- ui/snippets/header/HeaderMobile.tsx | 6 +- 4 files changed, 25 insertions(+), 89 deletions(-) delete mode 100644 ui/snippets/header/Header.tsx diff --git a/ui/shared/layout/LayoutApp.tsx b/ui/shared/layout/LayoutApp.tsx index 40e87d1b67..469ef3b536 100644 --- a/ui/shared/layout/LayoutApp.tsx +++ b/ui/shared/layout/LayoutApp.tsx @@ -3,21 +3,23 @@ import React from 'react'; import type { Props } from './types'; import AppErrorBoundary from 'ui/shared/AppError/AppErrorBoundary'; -import Header from 'ui/snippets/header/Header'; import HeaderAlert from 'ui/snippets/header/HeaderAlert'; +import HeaderDesktop from 'ui/snippets/header/HeaderDesktop'; +import HeaderMobile from 'ui/snippets/header/HeaderMobile'; import * as Layout from './components'; const LayoutDefault = ({ children }: Props) => { return ( + -
+ { children } diff --git a/ui/snippets/header/Header.tsx b/ui/snippets/header/Header.tsx deleted file mode 100644 index 9163c79c48..0000000000 --- a/ui/snippets/header/Header.tsx +++ /dev/null @@ -1,84 +0,0 @@ -import { HStack, Box, Flex, useColorModeValue } from '@chakra-ui/react'; -import React from 'react'; - -import config from 'configs/app'; -import { useScrollDirection } from 'lib/contexts/scrollDirection'; -import NetworkLogo from 'ui/snippets/networkMenu/NetworkLogo'; -import ProfileMenuDesktop from 'ui/snippets/profileMenu/ProfileMenuDesktop'; -import ProfileMenuMobile from 'ui/snippets/profileMenu/ProfileMenuMobile'; -import SearchBar from 'ui/snippets/searchBar/SearchBar'; -import WalletMenuDesktop from 'ui/snippets/walletMenu/WalletMenuDesktop'; -import WalletMenuMobile from 'ui/snippets/walletMenu/WalletMenuMobile'; - -import Burger from './Burger'; - -type Props = { - isHomePage?: boolean; - isMarketplaceAppPage?: boolean; - renderSearchBar?: () => React.ReactNode; -} - -const Header = ({ isHomePage, isMarketplaceAppPage, renderSearchBar }: Props) => { - const bgColor = useColorModeValue('white', 'black'); - const scrollDirection = useScrollDirection(); - - const searchBar = renderSearchBar ? renderSearchBar() : ; - - return ( - <> - - - - - - { config.features.account.isEnabled ? : } - { config.features.blockchainInteraction.isEnabled && } - - - { !isHomePage && searchBar } - - - { !isHomePage && ( - - { isMarketplaceAppPage && ( - - - - - ) } - - { searchBar } - - - { config.features.account.isEnabled && } - { config.features.blockchainInteraction.isEnabled && } - - - ) } - - - ); -}; - -export default Header; diff --git a/ui/snippets/header/HeaderDesktop.tsx b/ui/snippets/header/HeaderDesktop.tsx index bb74577036..5da9566f03 100644 --- a/ui/snippets/header/HeaderDesktop.tsx +++ b/ui/snippets/header/HeaderDesktop.tsx @@ -2,14 +2,19 @@ import { HStack, Box } from '@chakra-ui/react'; import React from 'react'; import config from 'configs/app'; +import NetworkLogo from 'ui/snippets/networkMenu/NetworkLogo'; import ProfileMenuDesktop from 'ui/snippets/profileMenu/ProfileMenuDesktop'; import SearchBar from 'ui/snippets/searchBar/SearchBar'; +import WalletMenuDesktop from 'ui/snippets/walletMenu/WalletMenuDesktop'; + +import Burger from './Burger'; type Props = { renderSearchBar?: () => React.ReactNode; + isMarketplaceAppPage?: boolean; } -const HeaderDesktop = ({ renderSearchBar }: Props) => { +const HeaderDesktop = ({ renderSearchBar, isMarketplaceAppPage }: Props) => { const searchBar = renderSearchBar ? renderSearchBar() : ; @@ -22,10 +27,19 @@ const HeaderDesktop = ({ renderSearchBar }: Props) => { justifyContent="center" gap={ 12 } > + { isMarketplaceAppPage && ( + + + + + ) } { searchBar } - { config.features.account.isEnabled && } + + { config.features.account.isEnabled && } + { config.features.blockchainInteraction.isEnabled && } + ); }; diff --git a/ui/snippets/header/HeaderMobile.tsx b/ui/snippets/header/HeaderMobile.tsx index 4da61d7305..9901d8b9f9 100644 --- a/ui/snippets/header/HeaderMobile.tsx +++ b/ui/snippets/header/HeaderMobile.tsx @@ -7,6 +7,7 @@ import { useScrollDirection } from 'lib/contexts/scrollDirection'; import NetworkLogo from 'ui/snippets/networkMenu/NetworkLogo'; import ProfileMenuMobile from 'ui/snippets/profileMenu/ProfileMenuMobile'; import SearchBar from 'ui/snippets/searchBar/SearchBar'; +import WalletMenuMobile from 'ui/snippets/walletMenu/WalletMenuMobile'; import Burger from './Burger'; @@ -47,7 +48,10 @@ const HeaderMobile = ({ isHomePage, renderSearchBar }: Props) => { > - { config.features.account.isEnabled ? : } + + { config.features.account.isEnabled ? : } + { config.features.blockchainInteraction.isEnabled && } + { !isHomePage && searchBar }