Enhance Next.js configuration and dependencies for improved functionality and localization support. Added support for internationalization with next-intl, updated global styles, and integrated new fonts. Removed default home page and updated README with project details and setup instructions.
This commit is contained in:
1 parent
2911dea00b
commit
44f4fa98e2
320 files changed
+31666
-220
No files matched your search
@@ -0,0 +1,43 @@
|
||||
import type { Metadata } from "next";
|
||||
import { notFound } from "next/navigation";
|
||||
import { Container } from "@/components/atoms/Container";
|
||||
import { Section } from "@/components/atoms/Section";
|
||||
import { PageHero } from "@/components/molecules/PageHero";
|
||||
import { getLegalPage } from "@/lib/data/site";
|
||||
|
||||
type Props = { params: Promise<{ slug: string }> };
|
||||
|
||||
const ALLOWED = new Set(["privacy", "accessibility", "press", "careers"]);
|
||||
|
||||
export async function generateStaticParams() {
|
||||
return [...ALLOWED].map((slug) => ({ slug }));
|
||||
}
|
||||
|
||||
export async function generateMetadata({ params }: Props): Promise<Metadata> {
|
||||
const { slug } = await params;
|
||||
const page = await getLegalPage(slug);
|
||||
if (!page) return { title: "صفحه یافت نشد" };
|
||||
return { title: page.title, description: page.body[0] };
|
||||
}
|
||||
|
||||
export default async function LegalSlugPage({ params }: Props) {
|
||||
const { slug } = await params;
|
||||
if (!ALLOWED.has(slug)) notFound();
|
||||
const page = await getLegalPage(slug);
|
||||
if (!page) notFound();
|
||||
|
||||
return (
|
||||
<main id="main-content">
|
||||
<PageHero title={page.title} />
|
||||
<Section className="bg-gradient-to-b from-background to-muted/40">
|
||||
<Container narrow className="space-y-5 rounded-2xl bg-card p-6 shadow-sm ring-1 ring-border sm:p-10">
|
||||
{page.body.map((paragraph) => (
|
||||
<p key={paragraph} className="leading-8 text-foreground/90">
|
||||
{paragraph}
|
||||
</p>
|
||||
))}
|
||||
</Container>
|
||||
</Section>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
import type { Metadata } from "next";
|
||||
import Link from "next/link";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { Container } from "@/components/atoms/Container";
|
||||
import { Heading } from "@/components/atoms/Heading";
|
||||
import { Section } from "@/components/atoms/Section";
|
||||
import { PageHero } from "@/components/molecules/PageHero";
|
||||
import { SurfaceCard } from "@/components/molecules/SurfaceCard";
|
||||
import { buttonVariants } from "@/components/ui/button";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { getTopics } from "@/lib/data/site";
|
||||
import { aboutFocusAreas, siteMission } from "@/lib/site-config";
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
const t = await getTranslations("pages");
|
||||
return { title: t("aboutTitle"), description: siteMission };
|
||||
}
|
||||
|
||||
export default async function AboutPage() {
|
||||
const t = await getTranslations("pages");
|
||||
const topics = await getTopics();
|
||||
|
||||
return (
|
||||
<main id="main-content">
|
||||
<PageHero title={t("aboutTitle")} intro={siteMission} />
|
||||
<Section className="relative overflow-hidden">
|
||||
<Container>
|
||||
<p className="text-xs font-bold text-primary">مسیرهای اثرگذاری</p><Heading level={2} className="mt-2 text-3xl sm:text-4xl">حوزههای تمرکز</Heading>
|
||||
<div className="mt-8 grid gap-4 sm:grid-cols-2">
|
||||
{aboutFocusAreas.map((area) => (
|
||||
<SurfaceCard key={area.title}>
|
||||
<Heading as="h3" level={4}>
|
||||
{area.title}
|
||||
</Heading>
|
||||
<p className="mt-2 text-sm text-muted-foreground">
|
||||
{area.description}
|
||||
</p>
|
||||
</SurfaceCard>
|
||||
))}
|
||||
</div>
|
||||
</Container>
|
||||
</Section>
|
||||
<Section tone="muted">
|
||||
<Container>
|
||||
<p className="text-xs font-bold text-primary">نگاه میانرشتهای</p><Heading level={2} className="mt-2 text-3xl sm:text-4xl">تقاطع مدیریت و فناوری</Heading>
|
||||
<div className="mt-6 grid gap-3 sm:grid-cols-2 lg:grid-cols-4">
|
||||
{topics.map((topic) => (
|
||||
<SurfaceCard key={topic.id} padded="sm" className="h-full">
|
||||
<Link href={topic.href} className="block">
|
||||
<span className="font-semibold hover:text-primary">
|
||||
{topic.title}
|
||||
</span>
|
||||
<p className="mt-2 text-sm text-muted-foreground">
|
||||
{topic.description}
|
||||
</p>
|
||||
</Link>
|
||||
</SurfaceCard>
|
||||
))}
|
||||
</div>
|
||||
<Link href="/programs" className={cn(buttonVariants(), "mt-8")}>
|
||||
کشف برنامهها
|
||||
</Link>
|
||||
</Container>
|
||||
</Section>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
import type { Metadata } from "next";
|
||||
import Image from "next/image";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { Container } from "@/components/atoms/Container";
|
||||
import { Heading } from "@/components/atoms/Heading";
|
||||
import { Section } from "@/components/atoms/Section";
|
||||
import { BadgeLabel } from "@/components/atoms/BadgeLabel";
|
||||
import { PageHero } from "@/components/molecules/PageHero";
|
||||
import { SurfaceCard } from "@/components/molecules/SurfaceCard";
|
||||
import { getAlumniStories } from "@/lib/data/site";
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
const t = await getTranslations("pages");
|
||||
return { title: t("alumniTitle"), description: t("alumniIntro") };
|
||||
}
|
||||
|
||||
export default async function AlumniPage() {
|
||||
const t = await getTranslations("pages");
|
||||
const stories = await getAlumniStories();
|
||||
|
||||
return (
|
||||
<main id="main-content">
|
||||
<PageHero title={t("alumniTitle")} intro={t("alumniIntro")} />
|
||||
<Section className="bg-gradient-to-b from-background to-muted/40">
|
||||
<Container>
|
||||
<div className="grid gap-8 md:grid-cols-3">
|
||||
{stories.map((story) => (
|
||||
<SurfaceCard
|
||||
key={story.id}
|
||||
id={story.id}
|
||||
padded={false}
|
||||
className="group scroll-mt-24 overflow-hidden rounded-2xl"
|
||||
>
|
||||
<div className="relative aspect-[16/10]">
|
||||
<Image
|
||||
src={story.imageUrl}
|
||||
alt={story.name}
|
||||
fill
|
||||
className="object-cover transition-transform duration-500 group-hover:scale-[1.03]"
|
||||
sizes="(max-width:768px) 100vw, 33vw"
|
||||
/>
|
||||
</div>
|
||||
<div className="p-5">
|
||||
<BadgeLabel>{story.program}</BadgeLabel>
|
||||
<Heading as="h2" level={4} className="mt-3">
|
||||
{story.title}
|
||||
</Heading>
|
||||
<p className="mt-2 text-sm leading-7 text-muted-foreground">
|
||||
{story.excerpt}
|
||||
</p>
|
||||
<p className="mt-4 text-sm font-semibold">{story.name}</p>
|
||||
</div>
|
||||
</SurfaceCard>
|
||||
))}
|
||||
</div>
|
||||
</Container>
|
||||
</Section>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
import type { Metadata } from "next";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { Container } from "@/components/atoms/Container";
|
||||
import { Heading } from "@/components/atoms/Heading";
|
||||
import { Section } from "@/components/atoms/Section";
|
||||
import { PageHero } from "@/components/molecules/PageHero";
|
||||
import { ContactInterestForm } from "@/components/organisms/ContactInterestForm";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import { siteAddress } from "@/lib/site-config";
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
const t = await getTranslations("pages");
|
||||
return { title: t("contactTitle"), description: t("contactIntro") };
|
||||
}
|
||||
|
||||
export default async function ContactPage() {
|
||||
const t = await getTranslations("pages");
|
||||
|
||||
return (
|
||||
<main id="main-content">
|
||||
<PageHero title={t("contactTitle")} intro={t("contactIntro")} />
|
||||
<Section className="bg-gradient-to-b from-background to-muted/40">
|
||||
<Container className="grid gap-10 lg:grid-cols-2">
|
||||
<div className="space-y-5 lg:pt-4">
|
||||
<Heading level={2}>اطلاعات تماس</Heading>
|
||||
<div className="space-y-3 text-sm leading-7 text-muted-foreground">
|
||||
<p>
|
||||
<span className="font-semibold text-foreground">آدرس: </span>
|
||||
{siteAddress.line}
|
||||
</p>
|
||||
<p dir="ltr">
|
||||
<span className="font-semibold text-foreground">تلفن: </span>
|
||||
{siteAddress.phone}
|
||||
</p>
|
||||
<p>
|
||||
<span className="font-semibold text-foreground">ایمیل: </span>
|
||||
<a
|
||||
href={`mailto:${siteAddress.email}`}
|
||||
className="text-primary hover:underline"
|
||||
>
|
||||
{siteAddress.email}
|
||||
</a>
|
||||
</p>
|
||||
<a
|
||||
href={siteAddress.mapUrl}
|
||||
className="inline-block text-primary hover:underline"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
مشاهده روی نقشه
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<Card className="rounded-2xl border-border/70 shadow-lg">
|
||||
<CardHeader>
|
||||
<CardTitle>ارسال پیام</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<ContactInterestForm
|
||||
submitLabel={t("submit")}
|
||||
successLabel={t("registerSuccess")}
|
||||
/>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Container>
|
||||
</Section>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
import { DotCta } from "@/components/atoms/DotCta";
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
||||
export default function MainError({
|
||||
error,
|
||||
reset,
|
||||
}: {
|
||||
error: Error & { digest?: string };
|
||||
reset: () => void;
|
||||
}) {
|
||||
useEffect(() => {
|
||||
console.error(error);
|
||||
}, [error]);
|
||||
|
||||
return (
|
||||
<div className="mx-auto flex min-h-[50vh] w-full max-w-7xl flex-col items-start justify-center px-5 py-20 sm:px-8 lg:px-12">
|
||||
<p className="text-sm font-semibold text-primary">خطا</p>
|
||||
<h1 className="mt-3 text-2xl font-bold tracking-tight sm:text-3xl">
|
||||
بارگذاری صفحه ناموفق بود
|
||||
</h1>
|
||||
<p className="mt-3 max-w-md text-base leading-relaxed text-muted-foreground">
|
||||
لطفاً دوباره تلاش کنید. اگر مشکل ادامه داشت، چند لحظه بعد بازگردید.
|
||||
</p>
|
||||
<div className="mt-8 flex flex-wrap gap-4">
|
||||
<Button type="button" onClick={reset}>
|
||||
تلاش مجدد
|
||||
</Button>
|
||||
<DotCta href="/">بازگشت به خانه</DotCta>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
import type { Metadata } from "next";
|
||||
import { notFound } from "next/navigation";
|
||||
import { Container } from "@/components/atoms/Container";
|
||||
import { Heading } from "@/components/atoms/Heading";
|
||||
import { Section } from "@/components/atoms/Section";
|
||||
import { TextLink } from "@/components/atoms/TextLink";
|
||||
import { PageHero } from "@/components/molecules/PageHero";
|
||||
import { getEventById } from "@/lib/data/events";
|
||||
|
||||
type Props = { params: Promise<{ id: string }> };
|
||||
|
||||
export async function generateMetadata({ params }: Props): Promise<Metadata> {
|
||||
const { id } = await params;
|
||||
const event = await getEventById(id);
|
||||
if (!event) return { title: "رویداد یافت نشد" };
|
||||
return { title: event.title, description: event.summary };
|
||||
}
|
||||
|
||||
export default async function EventDetailPage({ params }: Props) {
|
||||
const { id } = await params;
|
||||
const event = await getEventById(id);
|
||||
if (!event) notFound();
|
||||
|
||||
const start = new Date(event.startDate).toLocaleDateString("fa-IR", {
|
||||
year: "numeric",
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
});
|
||||
const end = event.endDate
|
||||
? new Date(event.endDate).toLocaleDateString("fa-IR", {
|
||||
year: "numeric",
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
})
|
||||
: null;
|
||||
|
||||
return (
|
||||
<main id="main-content">
|
||||
<PageHero title={event.title} intro={event.summary} />
|
||||
<Section className="bg-gradient-to-b from-background to-muted/40">
|
||||
<Container narrow className="space-y-5 rounded-2xl bg-card p-6 shadow-sm ring-1 ring-border sm:p-10">
|
||||
<p className="text-sm">
|
||||
<span className="font-semibold">زمان: </span>
|
||||
{start}
|
||||
{end ? ` تا ${end}` : ""}
|
||||
</p>
|
||||
<p className="text-sm">
|
||||
<span className="font-semibold">مکان: </span>
|
||||
{event.location}
|
||||
</p>
|
||||
<Heading level={3}>درباره رویداد</Heading>
|
||||
<p className="leading-8 text-foreground/90">{event.summary}</p>
|
||||
<TextLink href="/events">بازگشت به رویدادها</TextLink>
|
||||
</Container>
|
||||
</Section>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import type { Metadata } from "next";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { Container } from "@/components/atoms/Container";
|
||||
import { Section } from "@/components/atoms/Section";
|
||||
import { EventCard } from "@/components/molecules/Cards";
|
||||
import { PageHero } from "@/components/molecules/PageHero";
|
||||
import { getEvents } from "@/lib/data/events";
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
const t = await getTranslations("pages");
|
||||
return { title: t("eventsTitle"), description: t("eventsIntro") };
|
||||
}
|
||||
|
||||
export default async function EventsPage() {
|
||||
const t = await getTranslations("pages");
|
||||
const events = await getEvents();
|
||||
|
||||
return (
|
||||
<main id="main-content">
|
||||
<PageHero title={t("eventsTitle")} intro={t("eventsIntro")} />
|
||||
<Section className="bg-gradient-to-b from-background to-muted/40">
|
||||
<Container>
|
||||
<div className="grid gap-4 md:grid-cols-2">
|
||||
{events.map((event) => (
|
||||
<EventCard key={event.id} {...event} variant="list" />
|
||||
))}
|
||||
</div>
|
||||
</Container>
|
||||
</Section>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
import type { Metadata } from "next";
|
||||
import Image from "next/image";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { Container } from "@/components/atoms/Container";
|
||||
import { Heading } from "@/components/atoms/Heading";
|
||||
import { Section } from "@/components/atoms/Section";
|
||||
import { PageHero } from "@/components/molecules/PageHero";
|
||||
import { SurfaceCard } from "@/components/molecules/SurfaceCard";
|
||||
import { getFaculty } from "@/lib/data/site";
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
const t = await getTranslations("pages");
|
||||
return { title: t("facultyTitle"), description: t("facultyIntro") };
|
||||
}
|
||||
|
||||
export default async function FacultyPage() {
|
||||
const t = await getTranslations("pages");
|
||||
const members = await getFaculty();
|
||||
|
||||
return (
|
||||
<main id="main-content">
|
||||
<PageHero title={t("facultyTitle")} intro={t("facultyIntro")} />
|
||||
<Section className="bg-gradient-to-b from-background to-muted/40">
|
||||
<Container>
|
||||
<div className="grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
|
||||
{members.map((member) => (
|
||||
<SurfaceCard key={member.id} className="group rounded-2xl">
|
||||
<div className="relative mb-5 aspect-[4/3] overflow-hidden rounded-xl bg-muted">
|
||||
<Image
|
||||
src={member.imageUrl}
|
||||
alt={member.name}
|
||||
fill
|
||||
className="object-cover transition-transform duration-500 group-hover:scale-[1.03]"
|
||||
sizes="(max-width:768px) 100vw, 33vw"
|
||||
/>
|
||||
</div>
|
||||
<Heading as="h2" level={4}>
|
||||
{member.name}
|
||||
</Heading>
|
||||
<p className="mt-1 text-sm text-primary">{member.title}</p>
|
||||
<p className="mt-1 text-xs text-muted-foreground">
|
||||
{member.focus}
|
||||
</p>
|
||||
<p className="mt-3 text-sm leading-7 text-muted-foreground">
|
||||
{member.bio}
|
||||
</p>
|
||||
</SurfaceCard>
|
||||
))}
|
||||
</div>
|
||||
</Container>
|
||||
</Section>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
import type { Metadata } from "next";
|
||||
import Image from "next/image";
|
||||
import { notFound } from "next/navigation";
|
||||
import { Container } from "@/components/atoms/Container";
|
||||
import { Heading } from "@/components/atoms/Heading";
|
||||
import { Section } from "@/components/atoms/Section";
|
||||
import { BadgeLabel } from "@/components/atoms/BadgeLabel";
|
||||
import { MetamorphField } from "@/components/atoms/MetamorphField";
|
||||
import { TextLink } from "@/components/atoms/TextLink";
|
||||
import { getArticleById } from "@/lib/data/articles";
|
||||
import { JsonLd } from "@/lib/seo/json-ld";
|
||||
|
||||
type Props = { params: Promise<{ id: string }> };
|
||||
|
||||
export async function generateMetadata({ params }: Props): Promise<Metadata> {
|
||||
const { id } = await params;
|
||||
const article = await getArticleById(id);
|
||||
if (!article) return { title: "مقاله یافت نشد" };
|
||||
return { title: article.title, description: article.excerpt };
|
||||
}
|
||||
|
||||
export default async function InsightDetailPage({ params }: Props) {
|
||||
const { id } = await params;
|
||||
const article = await getArticleById(id);
|
||||
if (!article) notFound();
|
||||
|
||||
const date = new Date(article.publishedAt).toLocaleDateString("fa-IR");
|
||||
|
||||
return (
|
||||
<main id="main-content">
|
||||
<JsonLd
|
||||
data={{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "Article",
|
||||
headline: article.title,
|
||||
description: article.excerpt,
|
||||
datePublished: article.publishedAt,
|
||||
author: { "@type": "Person", name: article.author },
|
||||
image: article.imageUrl,
|
||||
}}
|
||||
/>
|
||||
<Section tone="dark" className="relative overflow-hidden pb-16 pt-16 sm:pb-20 sm:pt-20">
|
||||
<MetamorphField tone="dark" density="sparse" className="opacity-35" />
|
||||
<Container narrow className="relative z-[1]">
|
||||
<BadgeLabel>{article.category}</BadgeLabel>
|
||||
<Heading as="h1" level={1} className="mt-4 text-background">
|
||||
{article.title}
|
||||
</Heading>
|
||||
<p className="mt-3 text-sm text-background/60">
|
||||
{article.author} · {date}
|
||||
</p>
|
||||
</Container>
|
||||
</Section>
|
||||
<Section className="bg-gradient-to-b from-background to-muted/40 pt-10">
|
||||
<Container narrow>
|
||||
<div className="relative mb-10 aspect-[16/9] overflow-hidden rounded-2xl bg-muted shadow-xl">
|
||||
<Image
|
||||
src={article.imageUrl}
|
||||
alt={article.title}
|
||||
fill
|
||||
className="object-cover"
|
||||
sizes="(max-width:768px) 100vw, 800px"
|
||||
priority
|
||||
/>
|
||||
</div>
|
||||
<p className="text-lg leading-9 text-foreground/90">{article.body}</p>
|
||||
<TextLink href="/insights" className="mt-10 inline-block">
|
||||
بازگشت به مقالات
|
||||
</TextLink>
|
||||
</Container>
|
||||
</Section>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import type { Metadata } from "next";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { Container } from "@/components/atoms/Container";
|
||||
import { Section } from "@/components/atoms/Section";
|
||||
import { ArticleCard } from "@/components/molecules/Cards";
|
||||
import { PageHero } from "@/components/molecules/PageHero";
|
||||
import { getArticles } from "@/lib/data/articles";
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
const t = await getTranslations("pages");
|
||||
return { title: t("insightsTitle"), description: t("insightsIntro") };
|
||||
}
|
||||
|
||||
export default async function InsightsPage() {
|
||||
const t = await getTranslations("pages");
|
||||
const articles = await getArticles();
|
||||
|
||||
return (
|
||||
<main id="main-content">
|
||||
<PageHero title={t("insightsTitle")} intro={t("insightsIntro")} />
|
||||
<Section className="bg-gradient-to-b from-background to-muted/40">
|
||||
<Container>
|
||||
<div className="mx-auto max-w-5xl">
|
||||
{articles.map((article) => (
|
||||
<ArticleCard
|
||||
key={article.id}
|
||||
title={article.title}
|
||||
category={article.category}
|
||||
excerpt={article.excerpt}
|
||||
imageUrl={article.imageUrl}
|
||||
href={article.href}
|
||||
variant="list"
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</Container>
|
||||
</Section>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { CampaignBanners } from "@/components/organisms/CampaignBanners";
|
||||
import { SiteFooter } from "@/components/organisms/SiteFooter";
|
||||
import { SiteHeader } from "@/components/organisms/SiteHeader";
|
||||
import { getCourses } from "@/lib/data/courses";
|
||||
import { getPrograms } from "@/lib/data/programs";
|
||||
import { getCampaignBanners } from "@/lib/data/site";
|
||||
import { homeNav, siteShortName } from "@/lib/site-config";
|
||||
|
||||
export default async function MainLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
const t = await getTranslations();
|
||||
const year = new Date().getFullYear();
|
||||
const [courses, programs, banners] = await Promise.all([
|
||||
getCourses(),
|
||||
getPrograms(),
|
||||
getCampaignBanners(),
|
||||
]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<SiteHeader
|
||||
items={homeNav}
|
||||
searchLabel={t("nav.search")}
|
||||
brandTitle={siteShortName}
|
||||
brandSubtitle={t("nav.brandSubtitle")}
|
||||
academicsLabel={t("nav.academics")}
|
||||
programSelectorTitle={t("home.programSelectorTitle")}
|
||||
executiveLabel={t("home.executiveLabel")}
|
||||
exploreLabel={t("home.exploreOurPrograms")}
|
||||
variant="home"
|
||||
courses={courses}
|
||||
programs={programs}
|
||||
/>
|
||||
<CampaignBanners banners={banners} />
|
||||
<div className="flex-1">{children}</div>
|
||||
<SiteFooter
|
||||
copyright={t("footer.copyright", { year })}
|
||||
linksTitle={t("footer.links")}
|
||||
links={[
|
||||
{ label: t("footer.press"), href: "/press" },
|
||||
{ label: t("footer.careers"), href: "/careers" },
|
||||
{ label: t("footer.accessibility"), href: "/accessibility" },
|
||||
{ label: t("footer.privacy"), href: "/privacy" },
|
||||
]}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import {
|
||||
HomeEvents,
|
||||
HomeHero,
|
||||
HomeIdeas,
|
||||
HomeRest,
|
||||
type HomeLabels,
|
||||
} from "@/components/templates/HomeTemplate";
|
||||
import { getArticles, getFeaturedArticle } from "@/lib/data/articles";
|
||||
import { getEvents } from "@/lib/data/events";
|
||||
import { getPrograms } from "@/lib/data/programs";
|
||||
import { getSiteStats, getTopics } from "@/lib/data/site";
|
||||
|
||||
async function getLabels(): Promise<HomeLabels> {
|
||||
const t = await getTranslations();
|
||||
return {
|
||||
executiveLabel: t("home.executiveLabel"),
|
||||
exploreOurPrograms: t("home.exploreOurPrograms"),
|
||||
ideasTitle: t("home.ideasTitle"),
|
||||
eventsTitle: t("home.eventsTitle"),
|
||||
seeAllEvents: t("nav.seeAllEvents"),
|
||||
intersectionsTitle: t("home.intersectionsTitle"),
|
||||
intersectionsSubtitle: t("home.intersectionsSubtitle"),
|
||||
moreThanDegree: t("home.moreThanDegree"),
|
||||
moreThanDegreeBody: t("home.moreThanDegreeBody"),
|
||||
keepExploring: t("home.keepExploring"),
|
||||
hireTitle: t("home.hireTitle"),
|
||||
hireBody: t("home.hireBody"),
|
||||
registerCta: t("nav.registerCta"),
|
||||
missionTitle: t("home.missionTitle"),
|
||||
findUsTitle: t("home.findUsTitle"),
|
||||
ideasEyebrow: t("home.ideasEyebrow"),
|
||||
linksTitle: t("footer.links"),
|
||||
};
|
||||
}
|
||||
|
||||
async function HeroSection() {
|
||||
const [featured, labels] = await Promise.all([
|
||||
getFeaturedArticle(),
|
||||
getLabels(),
|
||||
]);
|
||||
if (!featured) return null;
|
||||
return <HomeHero featured={featured} eyebrow={labels.ideasEyebrow} />;
|
||||
}
|
||||
|
||||
async function IdeasSection() {
|
||||
const [articles, labels] = await Promise.all([getArticles(), getLabels()]);
|
||||
return <HomeIdeas articles={articles} title={labels.ideasTitle} />;
|
||||
}
|
||||
|
||||
async function EventsSection() {
|
||||
const [events, labels] = await Promise.all([getEvents(), getLabels()]);
|
||||
return (
|
||||
<HomeEvents
|
||||
events={events}
|
||||
title={labels.eventsTitle}
|
||||
seeAllLabel={labels.seeAllEvents}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
async function RestSection() {
|
||||
const [programs, intersections, stats, labels] = await Promise.all([
|
||||
getPrograms(),
|
||||
getTopics(),
|
||||
getSiteStats(),
|
||||
getLabels(),
|
||||
]);
|
||||
const carouselPrograms = programs.filter((p) =>
|
||||
[
|
||||
"management-core",
|
||||
"evening-management",
|
||||
"executive",
|
||||
"leadership-fellows",
|
||||
"business-analytics",
|
||||
"finance",
|
||||
].includes(p.slug),
|
||||
);
|
||||
return (
|
||||
<HomeRest
|
||||
labels={labels}
|
||||
carouselPrograms={carouselPrograms}
|
||||
intersections={intersections}
|
||||
stats={stats}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default function HomePage() {
|
||||
return (
|
||||
<main id="main-content">
|
||||
<HeroSection />
|
||||
<IdeasSection />
|
||||
<EventsSection />
|
||||
<RestSection />
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
import type { Metadata } from "next";
|
||||
import Link from "next/link";
|
||||
import { notFound } from "next/navigation";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { Container } from "@/components/atoms/Container";
|
||||
import { Heading } from "@/components/atoms/Heading";
|
||||
import { Section } from "@/components/atoms/Section";
|
||||
import { TextLink } from "@/components/atoms/TextLink";
|
||||
import { PageHero } from "@/components/molecules/PageHero";
|
||||
import { SurfaceCard } from "@/components/molecules/SurfaceCard";
|
||||
import { buttonVariants } from "@/components/ui/button";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { getCourses } from "@/lib/data/courses";
|
||||
import { getProgramBySlug } from "@/lib/data/programs";
|
||||
|
||||
type Props = { params: Promise<{ slug: string }> };
|
||||
|
||||
export async function generateMetadata({ params }: Props): Promise<Metadata> {
|
||||
const { slug } = await params;
|
||||
const program = await getProgramBySlug(slug);
|
||||
if (!program) return { title: "برنامه یافت نشد" };
|
||||
return {
|
||||
title: program.title,
|
||||
description: program.blurb,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function ProgramDetailPage({ params }: Props) {
|
||||
const { slug } = await params;
|
||||
const [program, courses, t] = await Promise.all([
|
||||
getProgramBySlug(slug),
|
||||
getCourses(),
|
||||
getTranslations("pages"),
|
||||
]);
|
||||
if (!program) notFound();
|
||||
|
||||
const related = courses.slice(0, 3);
|
||||
|
||||
return (
|
||||
<main id="main-content">
|
||||
<PageHero
|
||||
title={program.title}
|
||||
intro={program.blurb}
|
||||
eyebrow={program.tagline}
|
||||
/>
|
||||
<Section className="bg-gradient-to-b from-background to-muted/40">
|
||||
<Container className="grid gap-10 lg:grid-cols-[2fr_1fr]">
|
||||
<div>
|
||||
<p className="text-base leading-8 text-foreground/90">{program.body}</p>
|
||||
<Heading level={2} className="mt-10">
|
||||
{t("highlights")}
|
||||
</Heading>
|
||||
<ul className="mt-4 list-disc space-y-2 ps-5 text-sm leading-7">
|
||||
{program.highlights.map((item) => (
|
||||
<li key={item}>{item}</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
<aside className="h-fit space-y-4 rounded-2xl bg-card p-6 shadow-sm ring-1 ring-border">
|
||||
<p className="text-sm">
|
||||
<span className="font-semibold">مخاطب: </span>
|
||||
{program.audience}
|
||||
</p>
|
||||
<p className="text-sm">
|
||||
<span className="font-semibold">مدت: </span>
|
||||
{program.durationLabel}
|
||||
</p>
|
||||
<p className="text-sm">
|
||||
<span className="font-semibold">فرمت: </span>
|
||||
{program.formatLabel}
|
||||
</p>
|
||||
<Link
|
||||
href="/professional"
|
||||
className={cn(buttonVariants(), "w-full")}
|
||||
>
|
||||
مشاهده دورهها
|
||||
</Link>
|
||||
<TextLink href="/programs" className="block text-sm">
|
||||
{t("backToPrograms")}
|
||||
</TextLink>
|
||||
</aside>
|
||||
</Container>
|
||||
</Section>
|
||||
<Section tone="muted">
|
||||
<Container>
|
||||
<Heading level={2}>{t("relatedCourses")}</Heading>
|
||||
<ul className="mt-6 grid gap-4 sm:grid-cols-3">
|
||||
{related.map((course) => (
|
||||
<li key={course.id}>
|
||||
<SurfaceCard padded="sm" as="div" className="h-full">
|
||||
<Link
|
||||
href={course.registrationUrl}
|
||||
className="font-semibold hover:text-primary"
|
||||
>
|
||||
{course.title}
|
||||
</Link>
|
||||
<p className="mt-2 line-clamp-3 text-sm text-muted-foreground">
|
||||
{course.summary}
|
||||
</p>
|
||||
</SurfaceCard>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</Container>
|
||||
</Section>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
import type { Metadata } from "next";
|
||||
import Link from "next/link";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { Container } from "@/components/atoms/Container";
|
||||
import { Heading } from "@/components/atoms/Heading";
|
||||
import { Section } from "@/components/atoms/Section";
|
||||
import { BadgeLabel } from "@/components/atoms/BadgeLabel";
|
||||
import { PageHero } from "@/components/molecules/PageHero";
|
||||
import { SurfaceCard } from "@/components/molecules/SurfaceCard";
|
||||
import { buttonVariants } from "@/components/ui/button";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { getPrograms } from "@/lib/data/programs";
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
const t = await getTranslations("pages");
|
||||
return {
|
||||
title: t("programsTitle"),
|
||||
description: t("programsIntro"),
|
||||
};
|
||||
}
|
||||
|
||||
export default async function ProgramsPage() {
|
||||
const t = await getTranslations("pages");
|
||||
const programs = await getPrograms();
|
||||
const standard = programs.filter((p) => p.group === "standard");
|
||||
const executive = programs.filter((p) => p.group === "executive");
|
||||
|
||||
return (
|
||||
<main id="main-content">
|
||||
<PageHero title={t("programsTitle")} intro={t("programsIntro")} />
|
||||
<Section className="bg-gradient-to-b from-background to-muted/40">
|
||||
<Container className="space-y-10">
|
||||
<ProgramGroup title={t("standardGroup")} items={standard} />
|
||||
<ProgramGroup title={t("executiveGroup")} items={executive} />
|
||||
</Container>
|
||||
</Section>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
function ProgramGroup({
|
||||
title,
|
||||
items,
|
||||
}: {
|
||||
title: string;
|
||||
items: Awaited<ReturnType<typeof getPrograms>>;
|
||||
}) {
|
||||
return (
|
||||
<div>
|
||||
<Heading level={2} className="mb-6">
|
||||
{title}
|
||||
</Heading>
|
||||
<div className="grid gap-5 md:grid-cols-2">
|
||||
{items.map((program) => (
|
||||
<SurfaceCard key={program.id} className="flex flex-col rounded-2xl p-6 sm:p-7">
|
||||
<BadgeLabel className="w-fit">{program.tagline}</BadgeLabel>
|
||||
<Heading as="h3" level={3} className="mt-3">
|
||||
<Link href={program.href} className="hover:text-primary">
|
||||
{program.title}
|
||||
</Link>
|
||||
</Heading>
|
||||
<p className="mt-2 flex-1 text-sm leading-relaxed text-muted-foreground">
|
||||
{program.blurb}
|
||||
</p>
|
||||
<dl className="mt-4 grid grid-cols-2 gap-2 text-xs text-muted-foreground">
|
||||
<div>
|
||||
<dt className="font-semibold text-foreground">مخاطب</dt>
|
||||
<dd>{program.audience}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="font-semibold text-foreground">مدت</dt>
|
||||
<dd>{program.durationLabel}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt className="font-semibold text-foreground">فرمت</dt>
|
||||
<dd>{program.formatLabel}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
<Link
|
||||
href={program.href}
|
||||
className={cn(buttonVariants({ variant: "outline" }), "mt-5 w-fit")}
|
||||
>
|
||||
جزئیات برنامه
|
||||
</Link>
|
||||
</SurfaceCard>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import type { Metadata } from "next";
|
||||
import { notFound } from "next/navigation";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { CourseDetailTemplate } from "@/components/templates/CourseDetailTemplate";
|
||||
import { getCourseById } from "@/lib/data/courses";
|
||||
|
||||
type Props = { params: Promise<{ slug: string }> };
|
||||
|
||||
export async function generateMetadata({ params }: Props): Promise<Metadata> {
|
||||
const { slug } = await params;
|
||||
const course = await getCourseById(slug);
|
||||
if (!course) return { title: "دوره یافت نشد" };
|
||||
return {
|
||||
title: course.title,
|
||||
description: course.seoDescription || course.summary,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function CourseRegisterPage({ params }: Props) {
|
||||
const { slug } = await params;
|
||||
const [course, t] = await Promise.all([
|
||||
getCourseById(slug),
|
||||
getTranslations("pages"),
|
||||
]);
|
||||
if (!course) notFound();
|
||||
|
||||
return (
|
||||
<CourseDetailTemplate
|
||||
course={course}
|
||||
labels={{
|
||||
submit: t("submit"),
|
||||
success: t("registerSuccess"),
|
||||
cta: t("registerCtaRequest"),
|
||||
formTitle: t("registerFormTitle"),
|
||||
formDescription: t("registerFormDescription"),
|
||||
hint: t("registerFormHint"),
|
||||
cancel: t("registerFormCancel"),
|
||||
backToCatalog: t("backToCourses"),
|
||||
detailsTitle: t("courseDetailsTitle"),
|
||||
aboutTitle: t("courseAboutTitle"),
|
||||
duration: t("courseDuration"),
|
||||
format: t("courseFormat"),
|
||||
category: t("courseCategory"),
|
||||
price: t("coursePrice"),
|
||||
priceUnset: t("coursePriceUnset"),
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
import type { Metadata } from "next";
|
||||
import Link from "next/link";
|
||||
import { notFound } from "next/navigation";
|
||||
import { Container } from "@/components/atoms/Container";
|
||||
import { Section } from "@/components/atoms/Section";
|
||||
import { TextLink } from "@/components/atoms/TextLink";
|
||||
import { PageHero } from "@/components/molecules/PageHero";
|
||||
import { buttonVariants } from "@/components/ui/button";
|
||||
import { Separator } from "@/components/ui/separator";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { getTopicBySlug } from "@/lib/data/site";
|
||||
|
||||
type Props = { params: Promise<{ slug: string }> };
|
||||
|
||||
export async function generateMetadata({ params }: Props): Promise<Metadata> {
|
||||
const { slug } = await params;
|
||||
const topic = await getTopicBySlug(slug);
|
||||
if (!topic) return { title: "موضوع یافت نشد" };
|
||||
return { title: topic.title, description: topic.description };
|
||||
}
|
||||
|
||||
export default async function TopicPage({ params }: Props) {
|
||||
const { slug } = await params;
|
||||
const topic = await getTopicBySlug(slug);
|
||||
if (!topic) notFound();
|
||||
|
||||
return (
|
||||
<main id="main-content">
|
||||
<PageHero
|
||||
title={topic.title}
|
||||
intro={topic.description}
|
||||
imageUrl={topic.imageUrl}
|
||||
/>
|
||||
<Section className="bg-gradient-to-b from-background to-muted/40">
|
||||
<Container className="grid gap-10 lg:grid-cols-[2fr_1fr]">
|
||||
<div>
|
||||
<p className="text-base leading-8">{topic.body}</p>
|
||||
<ul className="mt-8 list-disc space-y-2 ps-5 text-sm">
|
||||
{topic.highlights.map((h) => (
|
||||
<li key={h}>{h}</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
<aside className="h-fit space-y-4 rounded-2xl bg-card p-6 shadow-sm ring-1 ring-border">
|
||||
<p className="text-sm text-muted-foreground">
|
||||
دورههای مرتبط با این موضوع را در فهرست دورههای کوتاه ببینید.
|
||||
</p>
|
||||
<Link href="/professional" className={cn(buttonVariants())}>
|
||||
مشاهده دورهها
|
||||
</Link>
|
||||
<Separator />
|
||||
<TextLink href="/" className="block text-sm">
|
||||
بازگشت به خانه
|
||||
</TextLink>
|
||||
</aside>
|
||||
</Container>
|
||||
</Section>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import type { Metadata } from "next";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { Container } from "@/components/atoms/Container";
|
||||
import { Section } from "@/components/atoms/Section";
|
||||
import { PageHero } from "@/components/molecules/PageHero";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { valuesContent } from "@/lib/site-config";
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
const t = await getTranslations("pages");
|
||||
return { title: t("valuesTitle"), description: valuesContent.intro };
|
||||
}
|
||||
|
||||
export default async function ValuesPage() {
|
||||
const t = await getTranslations("pages");
|
||||
|
||||
return (
|
||||
<main id="main-content">
|
||||
<PageHero title={t("valuesTitle")} intro={valuesContent.intro} />
|
||||
<Section className="bg-gradient-to-b from-background to-muted/40">
|
||||
<Container>
|
||||
<div className="grid gap-5 sm:grid-cols-2">
|
||||
{valuesContent.items.map((item) => (
|
||||
<Card key={item.title} className="rounded-2xl border-border/70 shadow-sm transition-[box-shadow,border-color] hover:border-primary/20 hover:shadow-md">
|
||||
<CardHeader>
|
||||
<CardTitle>{item.title}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<p className="text-sm leading-7 text-muted-foreground">
|
||||
{item.text}
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
))}
|
||||
</div>
|
||||
</Container>
|
||||
</Section>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user