Commit 10a19638 authored by aballerr's avatar aballerr Committed by GitHub

fix: reverting navbar change (#5237)

* reverting mobile navbar changes
parent be7e808f
...@@ -7,8 +7,7 @@ import { useIsNftPage } from 'hooks/useIsNftPage' ...@@ -7,8 +7,7 @@ import { useIsNftPage } from 'hooks/useIsNftPage'
import { Box } from 'nft/components/Box' import { Box } from 'nft/components/Box'
import { Row } from 'nft/components/Flex' import { Row } from 'nft/components/Flex'
import { UniIcon } from 'nft/components/icons' import { UniIcon } from 'nft/components/icons'
import { useIsMobile } from 'nft/hooks' import { ReactNode } from 'react'
import { ReactNode, useMemo } from 'react'
import { NavLink, NavLinkProps, useLocation } from 'react-router-dom' import { NavLink, NavLinkProps, useLocation } from 'react-router-dom'
import { Bag } from './Bag' import { Bag } from './Bag'
...@@ -72,30 +71,9 @@ const PageTabs = () => { ...@@ -72,30 +71,9 @@ const PageTabs = () => {
) )
} }
const useShouldHideNavbar = () => {
const { pathname } = useLocation()
const isMobile = useIsMobile()
const shouldHideNavbar = useMemo(() => {
const paths = ['/nfts/profile']
if (!isMobile) return false
for (const path of paths) {
if (pathname.includes(path)) return true
}
return false
}, [isMobile, pathname])
return shouldHideNavbar
}
const Navbar = () => { const Navbar = () => {
const shouldHideNavbar = useShouldHideNavbar()
const isNftPage = useIsNftPage() const isNftPage = useIsNftPage()
if (shouldHideNavbar) return null
return ( return (
<> <>
<nav className={styles.nav}> <nav className={styles.nav}>
......
...@@ -4,16 +4,14 @@ import { useWeb3React } from '@web3-react/core' ...@@ -4,16 +4,14 @@ import { useWeb3React } from '@web3-react/core'
import { useLoadNftBalanceQuery } from 'graphql/data/nft/NftBalance' import { useLoadNftBalanceQuery } from 'graphql/data/nft/NftBalance'
import { Box } from 'nft/components/Box' import { Box } from 'nft/components/Box'
import { Center, Column, Row } from 'nft/components/Flex' import { Center, Column, Row } from 'nft/components/Flex'
import { ChevronLeftIcon, XMarkIcon } from 'nft/components/icons' import { ChevronLeftIcon } from 'nft/components/icons'
import { ListPage } from 'nft/components/profile/list/ListPage' import { ListPage } from 'nft/components/profile/list/ListPage'
import { ProfilePage } from 'nft/components/profile/view/ProfilePage' import { ProfilePage } from 'nft/components/profile/view/ProfilePage'
import { ProfilePageLoadingSkeleton } from 'nft/components/profile/view/ProfilePageLoadingSkeleton' import { ProfilePageLoadingSkeleton } from 'nft/components/profile/view/ProfilePageLoadingSkeleton'
import { buttonMedium, headlineMedium, headlineSmall } from 'nft/css/common.css' import { buttonMedium, headlineMedium } from 'nft/css/common.css'
import { themeVars } from 'nft/css/sprinkles.css'
import { useBag, useNFTList, useProfilePageState, useSellAsset, useWalletCollections } from 'nft/hooks' import { useBag, useNFTList, useProfilePageState, useSellAsset, useWalletCollections } from 'nft/hooks'
import { ListingStatus, ProfilePageStateType } from 'nft/types' import { ListingStatus, ProfilePageStateType } from 'nft/types'
import { Suspense, useEffect, useRef } from 'react' import { Suspense, useEffect, useRef } from 'react'
import { useNavigate } from 'react-router-dom'
import { useToggleWalletModal } from 'state/application/hooks' import { useToggleWalletModal } from 'state/application/hooks'
import * as styles from './profile.css' import * as styles from './profile.css'
...@@ -27,7 +25,6 @@ const ProfileContent = () => { ...@@ -27,7 +25,6 @@ const ProfileContent = () => {
const resetSellAssets = useSellAsset((state) => state.reset) const resetSellAssets = useSellAsset((state) => state.reset)
const clearCollectionFilters = useWalletCollections((state) => state.clearCollectionFilters) const clearCollectionFilters = useWalletCollections((state) => state.clearCollectionFilters)
const setListingStatus = useNFTList((state) => state.setListingStatus) const setListingStatus = useNFTList((state) => state.setListingStatus)
const navigate = useNavigate()
useEffect(() => { useEffect(() => {
removeAllMarketplaceWarnings() removeAllMarketplaceWarnings()
...@@ -48,10 +45,6 @@ const ProfileContent = () => { ...@@ -48,10 +45,6 @@ const ProfileContent = () => {
}, [account, resetSellAssets, setSellPageState, clearCollectionFilters]) }, [account, resetSellAssets, setSellPageState, clearCollectionFilters])
const cartExpanded = useBag((state) => state.bagExpanded) const cartExpanded = useBag((state) => state.bagExpanded)
const exitSellFlow = () => {
navigate(-1)
}
return ( return (
<Trace page={PageName.NFT_PROFILE_PAGE} shouldLogImpression> <Trace page={PageName.NFT_PROFILE_PAGE} shouldLogImpression>
<Box className={styles.mobileSellWrapper}> <Box className={styles.mobileSellWrapper}>
...@@ -64,12 +57,6 @@ const ProfileContent = () => { ...@@ -64,12 +57,6 @@ const ProfileContent = () => {
<ChevronLeftIcon height={28} width={28} /> <ChevronLeftIcon height={28} width={28} />
</Box> </Box>
)} )}
<Box className={headlineSmall} paddingBottom="4" style={{ lineHeight: '28px' }}>
{sellPageState === ProfilePageStateType.VIEWING ? 'Select NFTs' : 'Create Listing'}
</Box>
<Box cursor="pointer" marginLeft="auto" marginRight="0" onClick={exitSellFlow}>
<XMarkIcon height={28} width={28} fill={themeVars.colors.textPrimary} />
</Box>
</Row> </Row>
{account != null ? ( {account != null ? (
<Box style={{ width: `calc(100% - ${cartExpanded ? SHOPPING_BAG_WIDTH : 0}px)` }}> <Box style={{ width: `calc(100% - ${cartExpanded ? SHOPPING_BAG_WIDTH : 0}px)` }}>
......
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