s
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
|
||||
import { useState } from "react";
|
||||
import { Link, useTranslation } from "@/app/digital/i18n/navigation";
|
||||
import { TOPIC_IDS } from "@/config/digital";
|
||||
import type { ResourceData } from "@/app/digital/lib/theme-data";
|
||||
import { useCrossSiteUrls } from "@/app/digital/lib/useCrossSiteUrls";
|
||||
import DigitalThemeIcon, { type IconName } from "./DigitalThemeIcon";
|
||||
import ResourceNavigation from "./ResourceNavigation";
|
||||
|
||||
const mainModuleKeys = ["destinations", "vipEntry", "appDownload"] as const;
|
||||
@@ -20,6 +20,16 @@ const linkIcons: Record<string, string> = {
|
||||
unmannedLive: "📺",
|
||||
};
|
||||
|
||||
const linkIconNames: Record<string, IconName> = {
|
||||
destinations: "map",
|
||||
vipEntry: "spark",
|
||||
appDownload: "phone",
|
||||
indieDev: "tool",
|
||||
aiAgent: "spark",
|
||||
cloudPhone: "cloud",
|
||||
unmannedLive: "video",
|
||||
};
|
||||
|
||||
type CommunityProps = {
|
||||
resourceData?: ResourceData;
|
||||
};
|
||||
@@ -41,25 +51,29 @@ export default function Community({ resourceData }: CommunityProps) {
|
||||
|
||||
const renderCardContent = (key: string) => (
|
||||
<>
|
||||
<span className="flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-slate-50 text-xl dark:bg-slate-800">
|
||||
{linkIcons[key]}
|
||||
<span className="dn-icon-box flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-slate-50 text-xl dark:bg-slate-800">
|
||||
<DigitalThemeIcon
|
||||
name={linkIconNames[key] ?? "compass"}
|
||||
emoji={linkIcons[key]}
|
||||
className="h-5 w-5"
|
||||
/>
|
||||
</span>
|
||||
<div className="min-w-0 flex-1">
|
||||
<h4 className="font-bold text-slate-900 dark:text-slate-100">{t(`links.${key}.title`)}</h4>
|
||||
<p className="mt-1 text-sm text-slate-500 dark:text-slate-400">{t(`links.${key}.desc`)}</p>
|
||||
<span className="mt-2 inline-block text-sm font-medium text-sky-600">{t(`links.${key}.label`)}</span>
|
||||
<span className="dn-text-link mt-2 inline-block text-sm font-medium text-sky-600">{t(`links.${key}.label`)}</span>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
||||
return (
|
||||
<section id="community" className="py-20 sm:py-28 dark:bg-slate-950">
|
||||
<div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
|
||||
<section id="community" className="dn-section dn-community py-20 sm:py-28 dark:bg-slate-950">
|
||||
<div className="dn-container mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
|
||||
<div id="resources" className="text-center">
|
||||
<h2 className="text-3xl font-bold tracking-tight text-slate-900 dark:text-slate-100 sm:text-4xl">
|
||||
<h2 className="dn-section-title text-3xl font-bold tracking-tight text-slate-900 dark:text-slate-100 sm:text-4xl">
|
||||
<span className="gradient-text">{t("resourcesTitle")}</span>
|
||||
</h2>
|
||||
<p className="mx-auto mt-4 max-w-2xl text-lg text-slate-600 dark:text-slate-400">
|
||||
<p className="dn-section-copy mx-auto mt-4 max-w-2xl text-lg text-slate-600 dark:text-slate-400">
|
||||
{t("contributeSubtitle")}
|
||||
<br />
|
||||
{t("contributeSubtitle2")}
|
||||
@@ -79,7 +93,7 @@ export default function Community({ resourceData }: CommunityProps) {
|
||||
href={href}
|
||||
target={newTab ? "_blank" : undefined}
|
||||
rel={newTab ? "noopener noreferrer" : undefined}
|
||||
className="card-hover flex items-start gap-5 rounded-2xl border-2 border-slate-200 bg-white p-6 shadow-md transition-all hover:border-sky-300 hover:shadow-lg dark:border-slate-700 dark:bg-slate-900 dark:hover:border-sky-600"
|
||||
className="dn-card card-hover flex items-start gap-5 rounded-2xl border-2 border-slate-200 bg-white p-6 shadow-md transition-all hover:border-sky-300 hover:shadow-lg dark:border-slate-700 dark:bg-slate-900 dark:hover:border-sky-600"
|
||||
>
|
||||
{renderCardContent(key)}
|
||||
</Link>
|
||||
@@ -98,10 +112,14 @@ export default function Community({ resourceData }: CommunityProps) {
|
||||
key={key}
|
||||
type="button"
|
||||
onClick={showUpdating}
|
||||
className="flex cursor-not-allowed items-start gap-4 rounded-xl border border-slate-200 bg-slate-50/80 p-4 opacity-90 transition-opacity hover:opacity-100 dark:border-slate-700 dark:bg-slate-800/60"
|
||||
className="dn-card dn-muted-card flex cursor-not-allowed items-start gap-4 rounded-xl border border-slate-200 bg-slate-50/80 p-4 opacity-90 transition-opacity hover:opacity-100 dark:border-slate-700 dark:bg-slate-800/60"
|
||||
>
|
||||
<span className="flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-slate-200 text-lg dark:bg-slate-700">
|
||||
{linkIcons[key]}
|
||||
<span className="dn-icon-box flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-slate-200 text-lg dark:bg-slate-700">
|
||||
<DigitalThemeIcon
|
||||
name={linkIconNames[key] ?? "compass"}
|
||||
emoji={linkIcons[key]}
|
||||
className="h-5 w-5"
|
||||
/>
|
||||
</span>
|
||||
<div className="min-w-0 flex-1 text-left">
|
||||
<h4 className="font-bold text-slate-700 dark:text-slate-300">{t(`links.${key}.title`)}</h4>
|
||||
|
||||
Reference in New Issue
Block a user