Skip to content

Commit

Permalink
fix(unlock-app): Cleanup redundant layout (#14883)
Browse files Browse the repository at this point in the history
* remove redundant layouts

* update not-found page

* update index content
  • Loading branch information
0xTxbi authored Oct 28, 2024
1 parent 6ca2911 commit f1840f5
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 112 deletions.
62 changes: 28 additions & 34 deletions unlock-app/app/not-found.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { ImageBar } from '~/components/interface/locks/Manage/elements/ImageBar'
import Link from 'next/link'
import { usePathname } from 'next/navigation'
import { Metadata } from 'next'
import { Container } from '~/components/interface/Container'
import DashboardHeader from '~/components/interface/layouts/index/DashboardHeader'

export const metadata: Metadata = {
title: 'Page Not Found',
Expand All @@ -17,37 +15,33 @@ export default function NotFound() {
const wasEventPage = pathname?.match(/\/event\//)

return (
<Container>
<DashboardHeader />

<div className="flex flex-col gap-10">
<h1 className="text-4xl font-bold text-center">
{wasEventPage ? 'Event Page Not Found' : 'Page Not Found'}
</h1>
<ImageBar
description={
wasEventPage ? (
<p>
The event page you were looking for could not be found. Back to{' '}
<Link href="/event" className="text-brand-ui-primary underline">
Event By Unlock
</Link>
</p>
) : (
'The page you were looking for could not be found.'
)
}
src="/images/illustrations/img-error.svg"
/>
{!wasEventPage && (
<p className="text-center">
Back to{' '}
<Link href="/" className="text-brand-ui-primary underline">
Home
</Link>
</p>
)}
</div>
</Container>
<div className="flex flex-col gap-10">
<h1 className="text-4xl font-bold text-center">
{wasEventPage ? 'Event Page Not Found' : 'Page Not Found'}
</h1>
<ImageBar
description={
wasEventPage ? (
<p>
The event page you were looking for could not be found. Back to{' '}
<Link href="/event" className="text-brand-ui-primary underline">
Event By Unlock
</Link>
</p>
) : (
'The page you were looking for could not be found.'
)
}
src="/images/illustrations/img-error.svg"
/>
{!wasEventPage && (
<p className="text-center">
Back to{' '}
<Link href="/" className="text-brand-ui-primary underline">
Home
</Link>
</p>
)}
</div>
)
}
21 changes: 0 additions & 21 deletions unlock-app/app/prime/layout.tsx

This file was deleted.

23 changes: 0 additions & 23 deletions unlock-app/app/transfer/layout.tsx

This file was deleted.

27 changes: 0 additions & 27 deletions unlock-app/app/verification/layout.tsx

This file was deleted.

9 changes: 2 additions & 7 deletions unlock-app/src/components/content/HomeContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
import { Launcher } from '../interface/Launcher'
import { useSession } from '~/hooks/useSession'
import { useAuthenticate } from '~/hooks/useAuthenticate'
import { Container } from '../interface/Container'
import DashboardHeader from '../interface/layouts/index/DashboardHeader'
import { ConnectModal } from '../interface/connect/ConnectModal'
import LocksContent from './lock/LocksContent'
import { Placeholder } from '@unlock-protocol/ui'

Expand All @@ -15,9 +12,7 @@ export const HomeContent = () => {
const { account } = useAuthenticate()

return (
<Container>
<ConnectModal />
<DashboardHeader />
<>
{isLoading && (
<Placeholder.Root>
<Placeholder.Card />
Expand All @@ -29,6 +24,6 @@ export const HomeContent = () => {
</div>
)}
{!account && !isLoading && <Launcher />}
</Container>
</>
)
}

0 comments on commit f1840f5

Please sign in to comment.