Commit 9e05c178 authored by vignesh mohankumar's avatar vignesh mohankumar Committed by GitHub

fix: move /profile to /nfts/profile (#5084)

* fix: move /profile to /nfts/profile

* add back variable

* fix

* rm shouldShowBag
parent d98808da
...@@ -23,7 +23,7 @@ export const ShoppingBag = () => { ...@@ -23,7 +23,7 @@ export const ShoppingBag = () => {
setSellQuantity(sellAssets.length) setSellQuantity(sellAssets.length)
}, [sellAssets]) }, [sellAssets])
const isProfilePage = location.pathname === '/profile' const isProfilePage = location.pathname === '/nfts/profile'
return ( return (
<NavIcon onClick={toggleBag}> <NavIcon onClick={toggleBag}>
......
...@@ -70,7 +70,7 @@ const PageTabs = () => { ...@@ -70,7 +70,7 @@ const PageTabs = () => {
const Navbar = () => { const Navbar = () => {
const { pathname } = useLocation() const { pathname } = useLocation()
const isNftPage = pathname.startsWith('/nfts') || pathname.startsWith('/profile') const isNftPage = pathname.startsWith('/nfts')
return ( return (
<> <>
......
...@@ -133,7 +133,7 @@ const AuthenticatedHeader = () => { ...@@ -133,7 +133,7 @@ const AuthenticatedHeader = () => {
}, [balanceString, nativeCurrencyPrice]) }, [balanceString, nativeCurrencyPrice])
const navigateToProfile = () => { const navigateToProfile = () => {
navigate('/profile') navigate('/nfts/profile')
closeModal() closeModal()
} }
......
...@@ -87,9 +87,8 @@ const Bag = () => { ...@@ -87,9 +87,8 @@ const Bag = () => {
const setBagExpanded = useBag((state) => state.setBagExpanded) const setBagExpanded = useBag((state) => state.setBagExpanded)
const { pathname } = useLocation() const { pathname } = useLocation()
const isProfilePage = pathname.startsWith('/profile') const isProfilePage = pathname.startsWith('/nfts/profile')
const isNFTPage = pathname.startsWith('/nfts') const isNFTPage = pathname.startsWith('/nfts')
const shouldShowBag = isNFTPage || isProfilePage
const isMobile = useIsMobile() const isMobile = useIsMobile()
const isDetailsPage = pathname.includes('/nfts/asset/') const isDetailsPage = pathname.includes('/nfts/asset/')
...@@ -266,7 +265,7 @@ const Bag = () => { ...@@ -266,7 +265,7 @@ const Bag = () => {
return ( return (
<> <>
{bagExpanded && shouldShowBag ? ( {bagExpanded && isNFTPage ? (
<Portal> <Portal>
<Column zIndex={isMobile || isOpen ? 'modal' : '3'} className={styles.bagContainer}> <Column zIndex={isMobile || isOpen ? 'modal' : '3'} className={styles.bagContainer}>
{!(isProfilePage && profilePageState === ProfilePageStateType.LISTING) ? ( {!(isProfilePage && profilePageState === ProfilePageStateType.LISTING) ? (
......
...@@ -15,7 +15,7 @@ const StyledColumn = styled(Column)<{ isProfilePage?: boolean }>` ...@@ -15,7 +15,7 @@ const StyledColumn = styled(Column)<{ isProfilePage?: boolean }>`
const EmptyState = () => { const EmptyState = () => {
const { pathname } = useLocation() const { pathname } = useLocation()
const isProfilePage = pathname.startsWith('/profile') const isProfilePage = pathname.startsWith('/nfts/profile')
return ( return (
<StyledColumn isProfilePage={isProfilePage}> <StyledColumn isProfilePage={isProfilePage}>
......
...@@ -242,7 +242,6 @@ export default function App() { ...@@ -242,7 +242,6 @@ export default function App() {
{nftFlag === NftVariant.Enabled && ( {nftFlag === NftVariant.Enabled && (
<> <>
<Route path="/profile" element={<Profile />} />
<Route path="/nfts" element={<NftExplore />} /> <Route path="/nfts" element={<NftExplore />} />
<Route <Route
path="/nfts/asset/:contractAddress/:tokenId" path="/nfts/asset/:contractAddress/:tokenId"
...@@ -252,6 +251,7 @@ export default function App() { ...@@ -252,6 +251,7 @@ export default function App() {
</Suspense> </Suspense>
} }
/> />
<Route path="/nfts/profile" element={<Profile />} />
<Route path="/nfts/collection/:contractAddress" element={<Collection />} /> <Route path="/nfts/collection/:contractAddress" element={<Collection />} />
<Route path="/nfts/collection/:contractAddress/activity" element={<Collection />} /> <Route path="/nfts/collection/:contractAddress/activity" element={<Collection />} />
</> </>
......
...@@ -30,7 +30,7 @@ export default function RadialGradientByChainUpdater(): null { ...@@ -30,7 +30,7 @@ export default function RadialGradientByChainUpdater(): null {
const { chainId } = useWeb3React() const { chainId } = useWeb3React()
const [darkMode] = useDarkModeManager() const [darkMode] = useDarkModeManager()
const { pathname } = useLocation() const { pathname } = useLocation()
const isNftPage = pathname.startsWith('/nfts') || pathname.startsWith('/profile') const isNftPage = pathname.startsWith('/nfts')
// manage background color // manage background color
useEffect(() => { useEffect(() => {
......
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