Skip to content

Commit 7d70c26

Browse files
committed
feat(frontend): add scale up animation to links
1 parent 9d86a47 commit 7d70c26

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

frontend/src/components/Footer.tsx

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ import React from "react";
22

33
import clsx from "clsx";
44
import Image from "next/image";
5+
import Link from "next/link";
56

67
import Button from "@/components/Button";
78
import { footerQueryType } from "@/queries/footer";
89

10+
const hoverScaleUp = clsx("hover:scale-105 transform transition duration-75");
11+
912
interface IFooter {
1013
footerData: footerQueryType;
1114
}
@@ -28,18 +31,32 @@ const Footer: React.FC<IFooter> = ({ footerData }) => {
2831
<h1 className="text-background-2">
2932
{title}
3033
</h1>
31-
{links.map(({ name }) => (
32-
<p key={name}>{name}</p>
34+
{links.map(({ name, url }) => (
35+
<Link
36+
className={clsx(hoverScaleUp, "w-max")}
37+
key={name}
38+
href={url}
39+
target={url.trim().startsWith("http") ? "_blank" : ""}
40+
rel="noopener noreferrer"
41+
>
42+
{name}
43+
</Link>
3344
))}
3445
</div>
3546
))}
3647
</div>
3748
<hr className="h-0.5 border-t-0 bg-secondary-purple mt-16 mb-6 mx-6"/>
3849
<div className="flex gap-8 justify-center items-center">
39-
{socials.map(({ name, icon_white: icon }) => (
40-
<div key={name}>
50+
{socials.map(({ name, icon_white: icon, url }) => (
51+
<Link
52+
className={hoverScaleUp}
53+
key={name}
54+
href={url}
55+
target="_blank"
56+
rel="noopener noreferrer"
57+
>
4158
<Image src={icon.url} alt={name} width="24" height="24" />
42-
</div>
59+
</Link>
4360
))}
4461
</div>
4562
</div>

frontend/src/queries/footer.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ export const footerQuery = gql`
77
title
88
links {
99
name
10+
url
1011
}
1112
}
1213
}
1314
footerSocialsSection {
1415
socials {
1516
name,
17+
url,
1618
icon_white {
1719
url
1820
}
@@ -34,13 +36,15 @@ export type footerQueryType = {
3436
Section: {
3537
title: string,
3638
links: {
37-
name: string
39+
name: string,
40+
url: string,
3841
}[],
3942
}[],
4043
},
4144
footerSocialsSection: {
4245
socials: {
4346
name: string,
47+
url: string,
4448
icon_white: {
4549
url: string
4650
},

0 commit comments

Comments
 (0)