Conversation
Co-authored-by: TechQuery <19969570+TechQuery@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add details page with map and comments section
Add activity detail page with map, comment box, and edit button
Mar 12, 2026
TechQuery
requested changes
Mar 12, 2026
…tivities route, add restaurant detail page Co-authored-by: TechQuery <19969570+TechQuery@users.noreply.github.com>
Copilot
AI
changed the title
Add activity detail page with map, comment box, and edit button
Add activity and restaurant detail pages with map, comment box, and edit button
Mar 12, 2026
TechQuery
requested changes
Mar 12, 2026
Member
TechQuery
left a comment
… links, new QR code Co-authored-by: TechQuery <19969570+TechQuery@users.noreply.github.com>
Contributor
Author
已全部完成(commit
|
TechQuery
requested changes
Mar 12, 2026
app/activities/[id]/page.tsx
Outdated
Comment on lines
-136
to
-137
| <Pencil className="w-4 h-4" /> | ||
| {t('detail.editOnGitHub')} |
Contributor
Author
There was a problem hiding this comment.
当前使用的 react-i18next 依赖 useContext hook,只能在客户端组件中调用。由于详情页已转为服务端组件(async Server Component),无法使用 useTranslation(),因此直接内联了中文字符串。
如果需要真正的服务端 i18n,可以引入 i18next 的 Node.js 后端(例如 i18next-fs-backend)并在服务端手动初始化实例,或者考虑 next-intl 等支持 RSC 的方案。目前规模较小,内联字符串是最简单的权宜方案。
…rrow FC wrapper, local QR image Co-authored-by: TechQuery <19969570+TechQuery@users.noreply.github.com>
TechQuery
approved these changes
Mar 12, 2026
TechQuery
approved these changes
Mar 12, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Each activity and restaurant now has a dedicated detail page that surfaces a location map, Giscus comment box, and a GitHub edit button — functionality previously absent from the listing views.
New components
components/ChinaMap.tsx— Wrapsopen-react-map'sOpenReactMapwith a GaoDe tile layer, matching the HOP reference implementation.components/ChinaMapWrapper.tsx— Minimal'use client'arrow-function component (FC<Props>) thatdynamic-importsChinaMapwithssr: false(required by Next.js 16, which forbidsssr: falseinside server components). Detail pages use<ChinaMapWrapper />directly.components/CommentBox.tsx— Wraps@giscus/reactconfigured forGoodAction-Hub/GoodAction-data(repo ID:R_kgDORijn4w, category:Polls, mapping:title, strict mode, emit metadata enabled, lang:zh-CN).New shared module
lib/activities.ts— ExtractsACTIVITIES_API_URL,ExternalEventData,ExternalDeadlineItem,transformEvent, andtransformIteminto a single shared module. Bothapp/api/data/route.tsandapp/activities/[id]/page.tsximport from it, eliminating duplication.New pages
app/activities/[id]/page.tsx— Async server component for activity details. Fetches data server-side using the sharedlib/activities.tsmodule, callsnotFound()when no matching record is found, renders full activity metadata + timeline, then conditionally shows the map (whenplaceis set), an Edit on GitHub button pointing to the data repo, and the Giscus comment box.app/restaurants/[id]/page.tsx— Async server component for restaurant details. Fetches data server-side viafetchBitesCatalog(), callsnotFound()when no matching record is found, renders name, description, accessibility tags, food types, features, address, and shows the map and Giscus comment box.Updated listing views
components/EventCard.tsx— Added anInfoicon link (/activities/{event.id}) on each card to navigate to the activity detail page.app/activities/page.tsx— Activities listing (previously/deadlines), with a new + 发布活动 button linking to the GitHub issue template for submitting new activities.app/restaurants/page.tsx— Restaurants listing (previously/Barrier-Free-Bites), with a new + 发布餐厅 button linking to the GitHub issue template for submitting new restaurants, and anInfoicon detail link on each restaurant card.Route renames & redirects
/deadlinesrenamed to/activitiesand/Barrier-Free-Bitesrenamed to/restaurantsthroughout the entire codebase (nav bar, home page links, back-buttons).next.config.ts— permanent 301 redirects defined with theredirects: async () => [...]inline style for both old top-level paths.Other changes
@import "leaflet/dist/leaflet.css"toapp/globals.css(required byopen-react-map).detail.*i18n keys to bothen/common.jsonandzh-CN/common.json./goodaction-hub-qr.png(served from the same domain for accessibility in mainland China). The PNG file must be placed atpublic/goodaction-hub-qr.png.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.