-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
1,160 additions
and
477 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import { promises as fs } from "fs"; | ||
Check failure on line 1 in src/app/[lng]/page-dialog.tsx
|
||
import { BackgroundBeams } from "@/components/animated/beams"; | ||
import { GlowingStarsBackgroundCard } from "@/components/animated/glowing-stars"; | ||
import { Card } from "@/components/ui/card"; | ||
import { Dialog, DialogContent, DialogTrigger } from "@/components/ui/dialog"; | ||
import { cn } from "@/lib/utils"; | ||
import { useMDXComponents } from "@/mdx-components"; | ||
import { compileMDX } from "next-mdx-remote/rsc"; | ||
import { Suspense } from "react"; | ||
|
||
async function getData(content: string, lng = "de") { | ||
try { | ||
const file = await fs.readFile( | ||
`${process.cwd()}/src/content/${content}/${content}.${lng}.mdx`, | ||
"utf8", | ||
); | ||
if (!file) return { mdxSource: "" }; | ||
return { mdxSource: file }; | ||
} catch (error) { | ||
return { mdxSource: "" }; | ||
} | ||
} | ||
|
||
export default async function PageDialog({ | ||
content, | ||
lng, | ||
animatedBackground, | ||
size, | ||
children, | ||
}: { | ||
content: string; | ||
lng: string; | ||
animatedBackground?: | ||
| "beams" | ||
| "glowing-stars" | ||
| "grid" | ||
| "background-gradient"; | ||
size?: "normal" | "large"; | ||
children: React.ReactNode; | ||
}) { | ||
const { mdxSource } = await getData(content, lng); | ||
|
||
const { content: mdxContent, frontmatter } = await compileMDX<{ | ||
title: string; | ||
}>({ | ||
source: mdxSource, | ||
options: { parseFrontmatter: true }, | ||
components: useMDXComponents({}), | ||
}); | ||
|
||
const Trigger = () => ( | ||
<Card | ||
className={cn( | ||
size === "large" ? "col-span-2" : "col-span-1", | ||
"from-muted to-background/90", | ||
"bg-gradient-to-br w-full break-inside-avoid relative rounded-md overflow-hidden group cursor-pointer", | ||
)} | ||
> | ||
{animatedBackground === "beams" && ( | ||
<BackgroundBeams className="group-hover:scale-105 transition-all" /> | ||
)} | ||
{animatedBackground === "glowing-stars" && ( | ||
<GlowingStarsBackgroundCard className="group-hover:scale-105 transition-all" /> | ||
)} | ||
{animatedBackground === "grid" && ( | ||
<div className="absolute top-0 left-0 w-full h-full group-hover:scale-105 transition-all"> | ||
<div className="h-full w-full bg-transparent bg-grid-white/[0.2] relative flex items-center justify-center"> | ||
<div className="absolute pointer-events-none inset-0 flex items-center justify-center bg-background [mask-image:radial-gradient(ellipse_at_center,transparent_20%,black)]" /> | ||
</div> | ||
</div> | ||
)} | ||
|
||
<div className="absolute top-0 left-0 w-full h-full p-4">{children}</div> | ||
</Card> | ||
); | ||
|
||
return ( | ||
<Dialog> | ||
<DialogTrigger asChild> | ||
<Trigger /> | ||
</DialogTrigger> | ||
<DialogContent className="max-w-7xl rounded-lg max-h-[80vh] overflow-auto no-scrollbar"> | ||
<Suspense fallback={"Loading..."}>{mdxContent}</Suspense> | ||
</DialogContent> | ||
</Dialog> | ||
); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,160 @@ | ||
import { i18n } from "@/components/pages/home/i18n"; | ||
import H1 from "@/components/ui/typography/H1"; | ||
import { redirect } from "next/navigation"; | ||
import PageDialog from "./page-dialog"; | ||
|
||
export default async function Page({ | ||
params, | ||
}: { | ||
params: { lng: "de" | "en" | "pt" }; | ||
}) { | ||
if (!params.lng || !["de", "en", "pt"].includes(params.lng)) redirect("/de"); | ||
|
||
return ( | ||
<div className="flex flex-col items-center w-full gap-12"> | ||
<div className="max-w-6xl mx-auto w-full"> | ||
<div className="grid md:auto-rows-[18rem] grid-cols-2 md:grid-cols-3 gap-4 max-w-7xl mx-auto auto-rows-[10rem]"> | ||
<div className="h-full w-full col-span-2 bg-dot-fuchsia-400/50 relative flex items-center justify-center"> | ||
<div className="absolute pointer-events-none inset-0 flex items-center justify-center bg-background [mask-image:radial-gradient(ellipse_at_center,transparent_45%,black)]" /> | ||
<H1 className="bg-clip-text text-transparent bg-gradient-to-b from-muted-foreground to-foreground"> | ||
Atrai Bikes | ||
</H1> | ||
</div> | ||
<PageDialog | ||
lng={params.lng} | ||
content="about" | ||
animatedBackground="beams" | ||
> | ||
<div className="absolute bottom-0 left-0 p-4"> | ||
<h2 className="text-2xl font-bold">{i18n[params.lng].about}</h2> | ||
</div> | ||
</PageDialog> | ||
<PageDialog | ||
lng={params.lng} | ||
content="hardware" | ||
animatedBackground="glowing-stars" | ||
size="large" | ||
> | ||
<div className="absolute top-0 right-0 p-4"> | ||
<h2 className="text-2xl font-bold"> | ||
{i18n[params.lng].hardware} | ||
</h2> | ||
</div> | ||
</PageDialog> | ||
|
||
<PageDialog | ||
lng={params.lng} | ||
content="partner" | ||
animatedBackground="grid" | ||
> | ||
<div className="absolute top-0 right-0 p-4"> | ||
<h2 className="text-2xl font-bold">{i18n[params.lng].partner}</h2> | ||
</div> | ||
</PageDialog> | ||
|
||
<PageDialog lng={params.lng} content="faq" animatedBackground="beams"> | ||
<div className="absolute top-0 right-0 p-4"> | ||
<h2 className="text-2xl font-bold">{i18n[params.lng].faq}</h2> | ||
</div> | ||
</PageDialog> | ||
|
||
<PageDialog | ||
lng={params.lng} | ||
content="blog" | ||
animatedBackground="beams" | ||
> | ||
<div className="absolute top-0 right-0 p-4"> | ||
<h2 className="text-2xl font-bold">{i18n[params.lng].blog}</h2> | ||
</div> | ||
</PageDialog> | ||
|
||
<PageDialog | ||
lng={params.lng} | ||
content="results" | ||
animatedBackground="beams" | ||
> | ||
<div className="absolute top-0 right-0 p-4"> | ||
<h2 className="text-2xl font-bold">{i18n[params.lng].results}</h2> | ||
</div> | ||
</PageDialog> | ||
|
||
<PageDialog | ||
lng={params.lng} | ||
content="analytics" | ||
animatedBackground="beams" | ||
size="large" | ||
> | ||
<div className="absolute top-0 right-0 p-4"> | ||
<h2 className="text-2xl font-bold"> | ||
{i18n[params.lng].analytics} | ||
</h2> | ||
</div> | ||
</PageDialog> | ||
|
||
{/* <BentoCard href={"/about"} animatedBackground="beams"> | ||
<div className="absolute bottom-0 left-0 p-4"> | ||
<h2 className="text-2xl font-bold">{i18n[lng].about}</h2> | ||
</div> | ||
</BentoCard> | ||
<BentoCard | ||
href={"/analytics"} | ||
image={DataAnalyticsImage} | ||
size="large" | ||
> | ||
<h2 className="text-2xl font-bold">{i18n[lng].analytics}</h2> | ||
</BentoCard> | ||
<BentoCard href={"/results"} animatedBackground="glowing-stars"> | ||
<h2 className="text-2xl font-bold">{i18n[lng].results}</h2> | ||
</BentoCard> | ||
<BentoCard href={"/blog"} animatedBackground="grid"> | ||
<div className="absolute top-0 left-0 w-full h-full flex items-center justify-center p-4"> | ||
<h2 className="text-2xl font-bold">{i18n[lng].blog}</h2> | ||
</div> | ||
</BentoCard> | ||
<BentoCard size="large" image={HardwareImage} href={"/hardware"}> | ||
<div className="absolute top-0 right-0 p-4"> | ||
<h2 className="text-2xl font-bold">{i18n[lng].hardware}</h2> | ||
</div> | ||
</BentoCard> | ||
<BentoCard href={"/partner"} size="large" animatedBackground="beams"> | ||
<div className="w-full h-full flex flex-col"> | ||
<h2 className="text-2xl font-bold">{i18n[lng].partner}</h2> | ||
<div className="w-full h-full flex items-center justify-around group-hover:scale-105 transition-all"> | ||
<div className="relative h-full aspect-square "> | ||
<Image | ||
src={ICImage} | ||
alt="Instituto Cordial" | ||
fill | ||
className="object-contain" | ||
/> | ||
</div> | ||
<div className="relative h-full aspect-square"> | ||
<Image | ||
src={ReeduImage} | ||
alt="Reedu" | ||
fill | ||
className="object-contain" | ||
/> | ||
</div> | ||
<div className="relative h-full aspect-square"> | ||
<Image | ||
src={Image52N} | ||
alt="52n" | ||
fill | ||
className="object-contain" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</BentoCard> | ||
<BentoCard href={"/faq"} animatedBackground="glowing-stars"> | ||
<h2 className="text-2xl font-bold">{i18n[lng].faq}</h2> | ||
</BentoCard> */} | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
// return <Home />; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.