|
1 | 1 | import React from "react"; |
2 | 2 |
|
| 3 | +import clsx from "clsx"; |
3 | 4 | import Image from "next/image"; |
| 5 | +import Link from "next/link"; |
4 | 6 |
|
5 | | -import { socialsQueryType } from "@/queries/socials"; |
| 7 | +import Button from "@/components/Button"; |
| 8 | +import { FooterQueryType } from "@/queries/footer"; |
| 9 | + |
| 10 | +const hoverScaleUp = clsx("hover:scale-105 transform transition duration-75"); |
6 | 11 |
|
7 | 12 | interface IFooter { |
8 | | - socials: socialsQueryType["socials"]; |
| 13 | + footerData: FooterQueryType; |
9 | 14 | } |
10 | 15 |
|
11 | | -const Footer: React.FC<IFooter> = ({ socials }) => { |
| 16 | +const Footer: React.FC<IFooter> = ({ footerData }) => { |
| 17 | + const socials = footerData.footerSocialsSection.socials; |
| 18 | + const sections = footerData.footerLinksSection.Section; |
| 19 | + const cta = footerData.footerSubscribeCta; |
12 | 20 | return ( |
13 | | - <div className={ |
14 | | - "py-4 bg-gradient-to-b from-secondary-blue to-30% to-primary-purple" |
15 | | - }> |
16 | | - <hr className="h-0.5 border-t-0 bg-secondary-purple mb-4 mx-2"/> |
17 | | - <div className="flex gap-4 justify-center align-middle"> |
18 | | - {socials.map(({ name, icon }) => ( |
19 | | - <div key={name}> |
20 | | - <Image src={icon.url} alt={name} width="24" height="24" /> |
21 | | - </div> |
22 | | - ))} |
| 21 | + <div> |
| 22 | + <div className={ |
| 23 | + clsx([ |
| 24 | + "bg-gradient-to-b from-secondary-blue to-[27.74%] to-primary-purple", |
| 25 | + "py-16" |
| 26 | + ]) |
| 27 | + }> |
| 28 | + <div className="flex flex-col gap-12 px-6"> |
| 29 | + {sections.map(({ title, links }) => ( |
| 30 | + <div key={title} className="flex flex-col gap-4"> |
| 31 | + <h2 className="text-background-2"> |
| 32 | + {title} |
| 33 | + </h2> |
| 34 | + {links.map(({ name, url }) => ( |
| 35 | + <Link |
| 36 | + className={clsx(hoverScaleUp, "w-max")} |
| 37 | + key={name} |
| 38 | + href={url} |
| 39 | + target={/^https?:\/\//.test(url) ? "_blank" : undefined} |
| 40 | + rel="noopener noreferrer" |
| 41 | + > |
| 42 | + {name} |
| 43 | + </Link> |
| 44 | + ))} |
| 45 | + </div> |
| 46 | + ))} |
| 47 | + </div> |
| 48 | + <hr className="h-0.5 border-t-0 bg-secondary-purple mt-16 mb-6 mx-6"/> |
| 49 | + <div className="flex gap-8 justify-center items-center"> |
| 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 | + > |
| 58 | + <Image src={icon.url} alt={name} width="24" height="24" /> |
| 59 | + </Link> |
| 60 | + ))} |
| 61 | + </div> |
| 62 | + </div> |
| 63 | + <div |
| 64 | + className={clsx( |
| 65 | + ["flex flex-col justify-center items-center"], |
| 66 | + ["bg-background-2 py-16"], |
| 67 | + )} |
| 68 | + > |
| 69 | + <Image |
| 70 | + src={cta.logo.url} |
| 71 | + alt="kleros logo" |
| 72 | + width="185" |
| 73 | + height="48" |
| 74 | + className="mb-8" |
| 75 | + /> |
| 76 | + <p className="mb-8">{cta.notice}</p> |
| 77 | + <p className="mb-6">{cta.cta_text}</p> |
| 78 | + <Button> |
| 79 | + <span className="text-background-2">{cta.cta_button}</span> |
| 80 | + </Button> |
23 | 81 | </div> |
24 | 82 | </div> |
25 | 83 | ); |
|
0 commit comments