nomadro/src/modules/social/components/HomeActionRail.tsx
Eric 893526942c Ship social theme switching, feedback image ops, and local skin debug ball.
Save current look as theme 1, add admin experience skin controls for themes 1-4, fix feedback image sync/lightbox, move hiring to the home bottom, and expose a localhost-only debug orb for instant skin preview.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-10 13:02:04 +08:00

53 lines
4.8 KiB
TypeScript

"use client";
import { useState } from "react";
import Link from "next/link";
import { ArrowUpRight, Coffee, Compass, Heart, Users } from "lucide-react";
import { socialPath } from "@social/lib/socialPath";
import { useSocialI18n } from "@social/lib/useSocialI18n";
import { useSocialConfig } from "./SocialExperience";
export default function HomeActionRail() {
const { tx } = useSocialI18n();
const config = useSocialConfig();
const [intent, setIntent] = useState("people");
const copy = config.copy.socialPages?.discovery;
if (config.copy.socialHiddenSections?.includes("discovery")) return null;
const journeys = [
{ id: "people", icon: Users, label: tx("认识朋友", "Meet people"),
title: tx("先找到同频,再聊得投机。", "Find your people. Let conversation follow."),
description: tx("从兴趣、城市和一段自我介绍开始,慢慢认识值得连接的人。", "Start with shared interests, a city, and a little introduction. Connect at your own pace."),
href: "/people", cta: tx("看看大家", "Meet the community"), secondary: "/date", secondaryLabel: tx("一张一张认识", "Discover one at a time"), step: tx("发现 → 关注 → 了解彼此", "Discover → Follow → Get to know each other") },
{ id: "coffee", icon: Coffee, label: tx("约杯咖啡", "Coffee & conversation"),
title: tx("留一点时间,认真聊一聊。", "Make time for a real conversation."),
description: tx("浏览咖啡聊主理人的介绍与可预约时间,找到适合自己的话题。", "Explore hosts and available times. Find a conversation that feels right for you."),
href: "/coffeechat", cta: tx("探索咖啡聊", "Explore coffee chats"), secondary: "/meetup", secondaryLabel: tx("先参加群聊", "Explore group meetups"), step: tx("选话题 → 看时间 → 预约见面", "Find a topic → Pick a time → Book a chat") },
{ id: "city", icon: Compass, label: tx("探索同城", "Explore a city"),
title: tx("陌生的城市,也有熟悉的同频。", "A new city. A familiar sense of connection."),
description: tx("挑一座城市,了解当地生活,再找适合工作、见面的咖啡馆。", "Choose a city, discover local life, and find a cafe for work or a friendly hello."),
href: "/places", cta: tx("逛逛城市", "Explore cities"), secondary: "/places?tab=cafes", secondaryLabel: tx("找一家咖啡馆", "Find a cafe"), step: tx("选城市 → 看地点 → 安排见面", "Choose a city → Find a place → Make a plan") },
{ id: "create", icon: Heart, label: tx("一起创造", "Build together"),
title: tx("把共同兴趣,变成一起做的事。", "Turn shared interests into something real."),
description: tx("从小册、视频共创到远程协作,找到可以一起行动的人和事。", "From co-creating guides and videos to remote collaboration, discover people and projects to build with."),
href: "/ebook", cta: tx("逛共创", "Browse co-create"), secondary: "/work", secondaryLabel: tx("远程协作", "Remote collaboration"), step: tx("逛共创 → 表达兴趣 → 一起行动", "Browse co-create → Express interest → Build together") },
];
const selected = journeys.find(journey => journey.id === intent) || journeys[0];
const selectedCopy = config.copy.socialPages?.[`discovery-${selected.id}`];
const Icon = selected.icon;
return (
<section className="container social-intent-guide" aria-labelledby="social-intent-title">
<div className="intent-heading"><span className="people-eyebrow">{copy?.eyebrow || tx("你的社区,你的节奏", "YOUR COMMUNITY. YOUR PACE.")}</span>
<h2 id="social-intent-title">{copy?.title || tx("今天,想从哪里开始?", "Where would you like to start?")}</h2>
</div>
<div className="intent-options" role="group" aria-label={tx("选择探索方向", "Choose what to explore")}>
{journeys.map(journey => { const Mark = journey.icon; return <button key={journey.id} type="button" aria-pressed={intent === journey.id} aria-controls="social-intent-panel" onClick={() => setIntent(journey.id)}><Mark size={18} />{journey.label}</button>; })}
</div>
<div className="intent-panel" id="social-intent-panel">
<div className="intent-art" aria-hidden="true"><span /><Icon size={42} strokeWidth={1.3} /><i /></div>
<div className="intent-panel-copy"><p className="intent-step">{selectedCopy?.eyebrow || selected.step}</p><h3>{selectedCopy?.title || selected.title}</h3><p>{selectedCopy?.description || selected.description}</p></div>
<div className="intent-panel-actions"><Link href={socialPath(selected.href)} className="social-btn primary">{selected.cta}<ArrowUpRight size={16} /></Link><Link href={socialPath(selected.secondary)}>{selected.secondaryLabel}<ArrowUpRight size={14} /></Link></div>
</div>
</section>
);
}