Skip to content

Commit 01d66a1

Browse files
committed
Merge branch 'feature/footer' into development
2 parents 9605d0b + c80ddb8 commit 01d66a1

File tree

3 files changed

+102
-3
lines changed

3 files changed

+102
-3
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
import Link from "./Link";
2+
3+
import Logo from "@/assets/images/brand/logo-200x200.webp";
4+
5+
interface FooterProps {
6+
7+
}
8+
9+
const Footer = ({ }: FooterProps) => {
10+
return (
11+
<footer className="flex items-center justify-center text-primary-contrast">
12+
<div className="flex flex-col w-full gap-4 p-8 max-w-7xl rounded-t-md bg-primary">
13+
<div className="flex flex-col items-center gap-2 p-2 rounded-md bg-white/20 sm:flex-row">
14+
<div className="flex items-center gap-2">
15+
<img
16+
className="w-12 h-12"
17+
src={Logo.src}
18+
width={Logo.width}
19+
height={Logo.height}
20+
/>
21+
<span className="font-semibold text-black">
22+
Commit Rocket
23+
</span>
24+
</div>
25+
<span className="hidden text-black/50 sm:block">
26+
-
27+
</span>
28+
<div className="text-black/50">
29+
© Rik den Breejen
30+
</div>
31+
</div>
32+
<div className="flex flex-col justify-between w-full gap-8 md:flex-row">
33+
<div className="flex flex-col">
34+
<p className="mb-2 text-lg font-semibold">Commit Rocket</p>
35+
<Link
36+
color="white"
37+
href="/blog"
38+
title="Commit Rocket Blog"
39+
underline
40+
>
41+
Blog
42+
</Link>
43+
<Link
44+
color="white"
45+
href="https://github.com/commit-rocket/commit-rocket"
46+
title="Commit Rocket Source-Code"
47+
underline
48+
external
49+
>
50+
Github
51+
</Link>
52+
</div>
53+
<div className="flex flex-col">
54+
<p className="mb-2 text-lg font-semibold">Website</p>
55+
<Link
56+
color="white"
57+
href="https://github.com/commit-rocket/commit-rocket-website"
58+
title="Commit Rocket Website Source-Code"
59+
underline
60+
external
61+
>
62+
Frontend Source
63+
</Link>
64+
<Link
65+
color="white"
66+
href="https://github.com/commit-rocket/commit-rocket-website-backend"
67+
title="Commit Rocket Website Backend Source-Code"
68+
underline
69+
external
70+
>
71+
Backend Source
72+
</Link>
73+
</div>
74+
<div className="flex flex-col">
75+
<p className="mb-2 text-lg font-semibold">More</p>
76+
<Link
77+
color="white"
78+
href="/about"
79+
title="About the creators of Commit Rocket"
80+
underline
81+
>
82+
About Us
83+
</Link>
84+
</div>
85+
</div>
86+
</div>
87+
</footer>
88+
);
89+
};
90+
91+
export default Footer;

src/components/navigation/Link.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { useMemo } from "react";
22
import InternalLink, { LinkProps as InternalLinkProps } from "next/link";
33
import { cva, VariantProps as GetVariantProps } from "class-variance-authority";
44
import { twMerge } from "tailwind-merge";
5+
import ArrowTopRightOnSquareIcon from "@heroicons/react/24/solid/ArrowTopRightOnSquareIcon";
56

67
import { RequiredKeys } from "@/types/utility";
78

@@ -26,20 +27,26 @@ export type VariantProps = GetVariantProps<typeof style>;
2627

2728
type LinkProps = {
2829
underline?: boolean;
30+
external?: boolean;
2931
} & RequiredKeys<VariantProps, "color">
3032
& Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof InternalLinkProps>
3133
& InternalLinkProps
3234
& React.RefAttributes<HTMLAnchorElement>;
3335

34-
const Link = ({ className, color, underline, ...props }: LinkProps) => {
36+
const Link = ({ className, color, underline, children, external, hrefLang = "en", ...props }: LinkProps) => {
3537

3638
const computedClassName = useMemo(
3739
() => twMerge(style({ color, underline }), className),
3840
[className, color, underline]
3941
);
4042

4143
return (
42-
<InternalLink className={computedClassName} {...props} />
44+
<InternalLink className={computedClassName} hrefLang={hrefLang} {...props}>
45+
{children}
46+
{external && <ArrowTopRightOnSquareIcon
47+
className="inline w-4 h-4"
48+
/>}
49+
</InternalLink>
4350
);
4451
};
4552

src/pages/_app.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Head from "next/head";
66

77
import '@/styles/main.css';
88
import Header from "@/components/navigation/Header";
9+
import Footer from "@/components/navigation/Footer";
910

1011
const openSans = Open_Sans({
1112
subsets: ['latin'],
@@ -49,7 +50,6 @@ export default function App({ Component, pageProps, router }: AppProps) {
4950
</Head>
5051
<div className={"flex flex-col overflow-auto scroll-smooth scroll-p-4 " + openSans.variable}>
5152
<Header />
52-
5353
<AnimatePresence mode="wait">
5454
<motion.div
5555
key={router.pathname}
@@ -68,6 +68,7 @@ export default function App({ Component, pageProps, router }: AppProps) {
6868
/>
6969
</motion.div>
7070
</AnimatePresence>
71+
<Footer />
7172
</div>
7273
</MotionConfig>
7374
);

0 commit comments

Comments
 (0)