Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(airdrops): Foundational layout components #15546

Merged
merged 5 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions airdrops/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Inter } from 'next/font/google'
import './globals.css'
import { Metadata } from 'next'
import RootHeader from '../components/layout/Header'
import Providers from '../components/providers'
import Footer from '../components/layout/Footer'

const inter = Inter({
subsets: ['latin'],
Expand All @@ -26,7 +28,9 @@ export default function RootLayout({
<Providers>
<body>
<div className="overflow-hidden bg-ui-secondary-200 px-4 mx-auto lg:container">
<RootHeader />
<div className="flex flex-col gap-10 min-h-screen">{children}</div>
<Footer />
</div>
</body>
</Providers>
Expand Down
8 changes: 8 additions & 0 deletions airdrops/components/layout/Container.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react'
interface Props {
children?: React.ReactNode
}

export const Container = ({ children }: Props) => {
return <div className="px-4 mx-auto lg:container">{children}</div>
}
30 changes: 30 additions & 0 deletions airdrops/components/layout/Footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import Link from 'next/link'

export default function Footer() {
return (
<div className="flex flex-col w-full gap-6 py-4 border-t border-gray-400 md:gap-0 md:items-center md:justify-between md:flex-row">
<span className="text-xs text-brand-dark">
&copy; Unlock Labs, {new Date().getFullYear()}
</span>
<div className="flex gap-8">
<Link
href="https://unlock-protocol.com/privacy"
className="text-xs text-brand-dark"
target="_blank"
rel="noopener noreferrer"
>
Privacy Policy
</Link>

<Link
href="https://unlock-protocol.com/terms"
className="text-xs text-brand-dark"
target="_blank"
rel="noopener noreferrer"
>
Term of Service
</Link>
</div>
</div>
)
}
40 changes: 40 additions & 0 deletions airdrops/components/layout/Header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
'use client'
import { usePrivy } from '@privy-io/react-auth'
import { Button, HeaderNav } from '@unlock-protocol/ui'

const MENU_SECTIONS = [
{ title: 'Events', url: '/my-events' },
{ title: 'Locks', url: '/locks' },
{ title: 'Keys', url: '/keychain' },
]

export default function RootHeader() {
const { authenticated, logout } = usePrivy()

const menuProps = {
extraClass: {
mobile: 'bg-ui-secondary-200 px-6',
},
showSocialIcons: false,
logo: {
url: '/',
src: '/images/svg/unlock-logo.svg',
},
menuSections: MENU_SECTIONS,
}

return (
<HeaderNav
{...menuProps}
actions={[
{
content: authenticated ? (
<Button size="small" variant="outlined-primary" onClick={logout}>
Disconnect
</Button>
) : null,
},
]}
/>
)
}
Loading