From 0594c76b95a738e0f21e649a643ae3369628932e Mon Sep 17 00:00:00 2001 From: yixuan Date: Tue, 14 Jul 2026 11:58:07 +0800 Subject: [PATCH] fix: preserve volunteer param in opportunity table view (#739) pass volunteerId prop from OpportunityListController down through the table list to OpportunityTableRow. --- .../Dashboard/Opportunities/OpportunityListController.tsx | 1 + .../Dashboard/Opportunities/OpportunityTableList.tsx | 3 +++ .../Dashboard/Opportunities/OpportunityTableRow.tsx | 6 ++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/Dashboard/Opportunities/OpportunityListController.tsx b/src/components/Dashboard/Opportunities/OpportunityListController.tsx index 49f35397..dd36d752 100644 --- a/src/components/Dashboard/Opportunities/OpportunityListController.tsx +++ b/src/components/Dashboard/Opportunities/OpportunityListController.tsx @@ -96,6 +96,7 @@ export function OpportunityListController({ currentPage={currentPage} setCurrentPage={setCurrentPage} districtsList={apiFilterOptions?.district ?? undefined} + volunteerId={volunteerId} /> ); } diff --git a/src/components/Dashboard/Opportunities/OpportunityTableList.tsx b/src/components/Dashboard/Opportunities/OpportunityTableList.tsx index fe0a2729..55f6a9c1 100644 --- a/src/components/Dashboard/Opportunities/OpportunityTableList.tsx +++ b/src/components/Dashboard/Opportunities/OpportunityTableList.tsx @@ -16,6 +16,7 @@ interface TableListProps { currentPage: number; setCurrentPage: (page: number) => void; districtsList?: OptionItem[]; + volunteerId?: string; } export function OpportunityTableList({ @@ -25,6 +26,7 @@ export function OpportunityTableList({ currentPage, setCurrentPage, districtsList, + volunteerId, }: TableListProps) { const { t } = useTranslation(); const { isAuthorized } = useAuth(); @@ -42,6 +44,7 @@ export function OpportunityTableList({ opportunity={opportunity} isLast={isLast} districtsList={districtsList} + volunteerId={volunteerId} /> ) : ( 1 ? numberOfVolunteers - 1 : 0; const matchedNames = firstName && otherVolunteersCount ? `${firstName} +${otherVolunteersCount}` : firstName; - const profileUrl = id ? `/${i18n.language}/dashboard/opportunities/${id}` : ""; + const params = volunteerId ? `?volunteer=${volunteerId}` : ""; + const profileUrl = id ? `/${i18n.language}/dashboard/opportunities/${id}${params}` : ""; return (