|
| 1 | +'use client'; |
| 2 | + |
| 3 | +import { Button, Flex, Image, Stack, Text } from '@ttoss/ui'; |
| 4 | +import Link from 'next/link'; |
| 5 | + |
| 6 | +const Header = ({ |
| 7 | + logo, |
| 8 | + title, |
| 9 | + links, |
| 10 | +}: { |
| 11 | + logo: string; |
| 12 | + title: string; |
| 13 | + links: React.ReactNode[]; |
| 14 | +}) => { |
| 15 | + return ( |
| 16 | + <Flex |
| 17 | + sx={{ |
| 18 | + alignItems: 'center', |
| 19 | + justifyContent: 'space-between', |
| 20 | + height: 72, |
| 21 | + paddingY: 'md', |
| 22 | + paddingX: ['md', 'md', 'lg'], |
| 23 | + backgroundColor: 'background', |
| 24 | + }} |
| 25 | + > |
| 26 | + <Flex sx={{ gap: 'md' }}> |
| 27 | + <Image src={logo} width={32} height={32} /> |
| 28 | + <Text sx={{ fontWeight: 'bold', fontSize: ['base', 'base', 'lg'] }}> |
| 29 | + {title} |
| 30 | + </Text> |
| 31 | + </Flex> |
| 32 | + <Flex |
| 33 | + sx={{ |
| 34 | + gap: 'lg', |
| 35 | + fontSize: ['md', 'md', 'md'], |
| 36 | + }} |
| 37 | + > |
| 38 | + {links} |
| 39 | + </Flex> |
| 40 | + </Flex> |
| 41 | + ); |
| 42 | +}; |
| 43 | + |
| 44 | +const Footer = () => { |
| 45 | + const year = new Date().getFullYear(); |
| 46 | + |
| 47 | + return ( |
| 48 | + <Stack |
| 49 | + sx={{ |
| 50 | + alignItems: 'center', |
| 51 | + justifyContent: 'center', |
| 52 | + height: 72, |
| 53 | + paddingY: 'md', |
| 54 | + backgroundColor: 'background', |
| 55 | + }} |
| 56 | + > |
| 57 | + <Link href="/">Home</Link> |
| 58 | + <Link href="/privacy">Privacy Policy</Link> |
| 59 | + <Text sx={{ fontSize: 'sm' }}>© {year} Tereza</Text> |
| 60 | + </Stack> |
| 61 | + ); |
| 62 | +}; |
| 63 | + |
| 64 | +const links = [ |
| 65 | + { |
| 66 | + href: '/my/journal', |
| 67 | + label: 'App', |
| 68 | + }, |
| 69 | +]; |
| 70 | + |
| 71 | +const LandingPageLayout = ({ children }: { children: React.ReactNode }) => { |
| 72 | + return ( |
| 73 | + <Flex sx={{ flexDirection: 'column', height: '100vh' }}> |
| 74 | + <Header |
| 75 | + title="Tereza" |
| 76 | + logo="/tereza200x200.webp" |
| 77 | + links={links.map(({ href, label }) => { |
| 78 | + return ( |
| 79 | + <Link href={href} key={href}> |
| 80 | + <Button>{label}</Button> |
| 81 | + </Link> |
| 82 | + ); |
| 83 | + })} |
| 84 | + /> |
| 85 | + <>{children}</> |
| 86 | + <Footer /> |
| 87 | + </Flex> |
| 88 | + ); |
| 89 | +}; |
| 90 | + |
| 91 | +export default LandingPageLayout; |
0 commit comments