Skip to content

Commit c80ddb8

Browse files
committed
Style up footer
1 parent 88ddcb4 commit c80ddb8

File tree

2 files changed

+84
-15
lines changed

2 files changed

+84
-15
lines changed

src/components/navigation/Footer.tsx

Lines changed: 75 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,87 @@
1-
import React from "react";
21
import Link from "./Link";
32

3+
import Logo from "@/assets/images/brand/logo-200x200.webp";
4+
45
interface FooterProps {
56

67
}
78

89
const Footer = ({ }: FooterProps) => {
910
return (
10-
<footer className="flex gap-4 p-4 bg-primary text-primary-contrast">
11-
<div>
12-
<p className="text-lg font-semibold text-center">Contact:</p>
13-
<div className="flex gap-2">
14-
<span className="font-semibold">Feedback:</span>
15-
<Link color="white" href="mailto:feedback@commitrocket.com" underline>feedback@commitrocket.com</Link>
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>
1631
</div>
17-
</div>
18-
<div>
19-
<p className="text-lg font-semibold text-center">Contact:</p>
20-
<div className="flex gap-2">
21-
<span className="font-semibold">Feedback:</span>
22-
<Link color="white" href="mailto:feedback@commitrocket.com" underline>feedback@commitrocket.com</Link>
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>
2385
</div>
2486
</div>
2587
</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

0 commit comments

Comments
 (0)