Skip to content

Commit

Permalink
feat: footer is now wide on all pages (#1311)
Browse files Browse the repository at this point in the history
  • Loading branch information
andyesp authored Oct 3, 2023
1 parent bde19a1 commit 7630019
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
7 changes: 1 addition & 6 deletions src/components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import React from 'react'

import { ChainId } from '@dcl/schemas/dist/dapps/chain-id'
import { useLocation } from '@reach/router'
import useAuthContext from 'decentraland-gatsby/dist/context/Auth/useAuthContext'
import env from 'decentraland-gatsby/dist/utils/env'
import { Footer } from 'decentraland-ui/dist/components/Footer/Footer'
import { Navbar, NavbarProps } from 'decentraland-ui/dist/components/Navbar/Navbar'
import type { PageProps } from 'gatsby'

import { isProjectPath } from '../../utils/locations'
import WalletSelectorModal from '../Modal/WalletSelectorModal'
import WrongNetworkModal from '../Modal/WrongNetworkModal'

Expand All @@ -30,7 +28,6 @@ export type LayoutProps = Omit<PageProps, 'children'> & {

export default function Layout({ children, ...props }: LayoutProps) {
const [, state] = useAuthContext()
const location = useLocation()

const handleClickMenuOption = function (event: React.MouseEvent, section: string) {
if (!event.defaultPrevented) {
Expand All @@ -44,8 +41,6 @@ export default function Layout({ children, ...props }: LayoutProps) {
return null
}

const isWiderLayout = isProjectPath(location.pathname)

return (
<>
<Navbar activePage="dao" onClickMenuOption={handleClickMenuOption} rightMenu={props.rightMenu} />
Expand All @@ -64,7 +59,7 @@ export default function Layout({ children, ...props }: LayoutProps) {
onConnect={(providerType, chainId) => state.connect(providerType, chainId)}
onClose={() => state.select(false)}
/>
<Footer locale="en" locales={['en']} isFullWidth={false} className={isWiderLayout ? 'WiderFooter' : undefined} />
<Footer locale="en" locales={['en']} isFullWidth={false} className="WiderFooter" />
</>
)
}
4 changes: 0 additions & 4 deletions src/utils/locations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,3 @@ export function navigate(to: string, options?: NavigateOptions<any>) {
}
gatsbyNavigate(to, options)
}

export function isProjectPath(pathname: string) {
return pathname.includes('/projects')
}

0 comments on commit 7630019

Please sign in to comment.