created basic footer
continuous-integration/drone/push Build is passing Details

pull/1/head
Guus van Meerveld 9 months ago
parent a48039a480
commit d00cd2763e

@ -9,5 +9,21 @@
"linkedin": "https://linkedin.com/in/guus-van-meerveld-038357210" "linkedin": "https://linkedin.com/in/guus-van-meerveld-038357210"
} }
}, },
"footer": {} "footer": {
"columns": [
{
"title": "Built with",
"links": [
{ "url": "https://nextjs.org/", "text": "Next.js" },
{ "url": "https://nextui.org/", "text": "NextUI" }
]
},
{
"title": "Social",
"links": [
{ "url": "https://github.com/Guusvanmeerveld", "text": "Github" }
]
}
]
}
} }

@ -12,29 +12,29 @@ import { FiGithub, FiMail, FiLinkedin } from "react-icons/fi";
import HeaderProps from "@models/header"; import HeaderProps from "@models/header";
export const Header: Component<{ header: HeaderProps; avatar: string }> = ({ export const Header: Component<{ data: HeaderProps; avatar: string }> = ({
header, data,
avatar avatar
}) => { }) => {
const socials = useMemo( const socials = useMemo(
() => [ () => [
{ {
link: `mailto:${header.contact.email}`, link: `mailto:${data.contact.email}`,
name: "Email address", name: "Email address",
icon: <FiMail /> icon: <FiMail />
}, },
{ {
link: header.contact.git, link: data.contact.git,
name: "Github", name: "Github",
icon: <FiGithub /> icon: <FiGithub />
}, },
{ {
link: header.contact.linkedin, link: data.contact.linkedin,
name: "LinkedIn", name: "LinkedIn",
icon: <FiLinkedin /> icon: <FiLinkedin />
} }
], ],
[header.contact] [data.contact]
); );
return ( return (
@ -44,31 +44,35 @@ export const Header: Component<{ header: HeaderProps; avatar: string }> = ({
isBlurred isBlurred
src={avatar} src={avatar}
width={300} width={300}
alt={`A picture of ${header.fullName}`} alt={`A picture of ${data.fullName}`}
/> />
<Spacer x={8} /> <Spacer x={8} />
<div> <div>
<h1 className="text-4xl">{header.fullName}</h1> <h1 className="text-4xl">{data.fullName}</h1>
<Spacer y={4} /> <Spacer y={4} />
<h2 className="text-2xl">{header.description}</h2> <h2 className="text-2xl">{data.description}</h2>
<Spacer y={4} /> <Spacer y={4} />
{socials.map((social) => ( {socials.map((social) => (
<Link href={social.link} key={social.name.toLowerCase()}> <Tooltip
<Tooltip showArrow content={social.name}> key={social.name.toLowerCase()}
<Button showArrow
className="text-2xl mr-4" content={social.name}
color="primary" >
isIconOnly <Button
aria-label={social.name} href={social.link}
> as={Link}
{social.icon} className="text-2xl mr-4"
</Button> color="primary"
</Tooltip> isIconOnly
</Link> aria-label={social.name}
>
{social.icon}
</Button>
</Tooltip>
))} ))}
</div> </div>
</div> </div>

@ -11,8 +11,8 @@ export default async function Page() {
return ( return (
<> <>
<Header header={landing.header} avatar={avatar} /> <Header data={landing.header} avatar={avatar} />
<Footer /> <Footer data={landing.footer} />
</> </>
); );
} }

@ -1,12 +1,44 @@
"use client";
import { Divider, Link } from "@nextui-org/react";
import { Component } from "@typings/component"; import { Component } from "@typings/component";
export const Footer: Component = () => { import { ThemeSwitcher } from "./ThemeSwitcher";
import FooterProps from "@models/footer";
export const Footer: Component<{ data: FooterProps }> = ({ data }) => {
return ( return (
<div className="container mx-auto columns-4"> <div className="container mx-auto grid grid-flow-col justify-stretch my-4">
<div className="w-full">hi</div> <div className="mx-4">
<div className="w-full">hi</div> <h1 className="text-xl">
<div className="w-full">hi</div> Created with{" "}
<div className="w-full">hi</div> <span role="img" aria-label="Red Heart">
&#x2764;&#xfe0f;
</span>{" "}
by Guus van Meerveld
</h1>
<Divider className="my-4" />
<ThemeSwitcher />
</div>
{data.columns.map((column) => (
<div className="mx-4" key={column.title.toLowerCase()}>
<h1 className="text-xl">{column.title}</h1>
<Divider className="mt-4" />
{column.links.map((link) => (
<div className="my-4" key={link.url}>
<Link className="text-default-500" href={link.url}>
{link.text}
</Link>
</div>
))}
</div>
))}
</div> </div>
); );
}; };

@ -0,0 +1,48 @@
"use client";
import {
Button,
Link,
Navbar,
NavbarBrand,
NavbarContent,
NavbarItem
} from "@nextui-org/react";
import { Component } from "@typings/component";
export const Nav: Component = () => {
return (
<Navbar position="sticky">
<NavbarBrand>
<p className="font-bold text-inherit">ACME</p>
</NavbarBrand>
<NavbarContent className="hidden sm:flex gap-4" justify="center">
<NavbarItem>
<Link color="foreground" href="#">
Features
</Link>
</NavbarItem>
<NavbarItem isActive>
<Link href="#" aria-current="page">
Customers
</Link>
</NavbarItem>
<NavbarItem>
<Link color="foreground" href="#">
Integrations
</Link>
</NavbarItem>
</NavbarContent>
<NavbarContent justify="end">
<NavbarItem className="hidden lg:flex">
<Link href="#">Login</Link>
</NavbarItem>
<NavbarItem>
<Button as={Link} color="primary" href="#" variant="flat">
Sign Up
</Button>
</NavbarItem>
</NavbarContent>
</Navbar>
);
};

@ -18,20 +18,15 @@ export const ThemeSwitcher: Component = () => {
if (!mounted) return null; if (!mounted) return null;
return ( return (
<div> <Switch
The current theme is: {theme} defaultSelected
<Switch size="lg"
defaultSelected color="primary"
size="lg" onValueChange={(value) => {
color="primary" value ? setTheme("dark") : setTheme("light");
onValueChange={(value) => { }}
value ? setTheme("dark") : setTheme("light"); startContent={<FiSun />}
}} endContent={<FiMoon />}
startContent={<FiSun />} />
endContent={<FiMoon />}
>
Dark mode
</Switch>
</div>
); );
}; };

@ -1,6 +1,13 @@
import z from "zod"; import z from "zod";
export const FooterPropsModel = z.object({}); const FooterColumnModel = z.object({
title: z.string(),
links: z.object({ url: z.string().url(), text: z.string() }).array()
});
export const FooterPropsModel = z.object({
columns: FooterColumnModel.array()
});
export type FooterProps = z.infer<typeof FooterPropsModel>; export type FooterProps = z.infer<typeof FooterPropsModel>;

Loading…
Cancel
Save