generated from Blazity/next-enterprise
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/Blazity/hygraph-next-enterp…
- Loading branch information
Showing
11 changed files
with
122 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,72 @@ | ||
import { Facebook, Instagram, Twitter, Youtube } from "lucide-react" | ||
import Image from "next/image" | ||
import Link from "next/link" | ||
import { Locale } from "@/i18n/i18n" | ||
import { getFooter } from "@/lib/client" | ||
import { DynamicLangSelect } from "../LangSelect/DynamicLangSelect" | ||
import { GetNavigationReturn } from "../Navigation/Navigation" | ||
|
||
type FooterProps = { | ||
footer: Pick<GetNavigationReturn, "footer">["footer"] | ||
lang: Locale | ||
} | ||
|
||
export async function Footer({ lang }: FooterProps) { | ||
const footer = await getFooter(lang) | ||
|
||
export async function Footer({ lang, footer }: FooterProps) { | ||
if (!footer?.contactSection) return null | ||
const { street, city, country, postCode } = footer.contactSection | ||
const { companyName, links, instagramLink, facebookLink, twitterLink, youtubeLink } = footer | ||
return ( | ||
<footer className="flex w-full items-center justify-center border-t border-slate-200"> | ||
<nav className="w-full max-w-[1200px] p-4"> | ||
<ul className="flex gap-5"> | ||
{footer.pages.map((footerElement) => ( | ||
<li key={footerElement?.slug}> | ||
<Link href={`/${lang}/${footerElement?.slug}`} hrefLang={lang}> | ||
{footerElement?.title} | ||
</Link> | ||
</li> | ||
))} | ||
</ul> | ||
</nav> | ||
<footer className="flex w-full items-center justify-center bg-custom-gray-200 py-12"> | ||
<div className="flex w-full max-w-[1200px] flex-wrap justify-between gap-10 p-4 lg:gap-0"> | ||
<div className="flex flex-col justify-between gap-10 md:gap-0"> | ||
<Image src={footer?.logo?.url ?? ""} width={100} height={30} alt="site-logo" quality={100} /> | ||
<div className="text-sm"> | ||
<p className="font-bold">{companyName}</p> | ||
<p>{street}</p> | ||
<div className="flex gap-2"> | ||
<p>{postCode}</p> | ||
<p>{city}</p> | ||
</div> | ||
<p>{country}</p> | ||
</div> | ||
</div> | ||
<nav className="flex flex-col gap-10 md:gap-7"> | ||
<div className="flex gap-4"> | ||
<Link href={twitterLink ?? ""} target="_blank"> | ||
<Twitter /> | ||
</Link> | ||
<Link href={facebookLink ?? ""} target="_blank"> | ||
<Facebook /> | ||
</Link> | ||
<Link href={instagramLink ?? ""} target="_blank"> | ||
<Instagram /> | ||
</Link> | ||
<Link href={youtubeLink ?? ""} target="_blank"> | ||
<Youtube /> | ||
</Link> | ||
</div> | ||
<ul className="grid grid-cols-3 gap-x-10 gap-y-7 text-sm font-semibold md:gap-x-20"> | ||
{links?.map((footerElement) => { | ||
const categoryUrl = footerElement.element?.__typename === "Category" ? "/category" : "" | ||
const url = `/${lang}${categoryUrl}/${footerElement?.element?.slug}` | ||
return ( | ||
<li key={footerElement?.element?.slug}> | ||
<Link href={url} hrefLang={lang}> | ||
{footerElement?.element?.title} | ||
</Link> | ||
</li> | ||
) | ||
})} | ||
</ul> | ||
</nav> | ||
<div className="flex flex-col justify-between gap-10 lg:gap-0"> | ||
<div className="flex w-1/3 justify-end lg:w-full"> | ||
<DynamicLangSelect /> | ||
</div> | ||
<p className="text-sm text-custom-gray-300"> | ||
© {new Date().getFullYear()} {companyName} All rights reserved. | ||
</p> | ||
</div> | ||
</div> | ||
</footer> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters