Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export function OpportunityListController({
currentPage={currentPage}
setCurrentPage={setCurrentPage}
districtsList={apiFilterOptions?.district ?? undefined}
volunteerId={volunteerId}
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ interface TableListProps {
currentPage: number;
setCurrentPage: (page: number) => void;
districtsList?: OptionItem[];
volunteerId?: string;
}

export function OpportunityTableList({
Expand All @@ -25,6 +26,7 @@ export function OpportunityTableList({
currentPage,
setCurrentPage,
districtsList,
volunteerId,
}: TableListProps) {
const { t } = useTranslation();
const { isAuthorized } = useAuth();
Expand All @@ -42,6 +44,7 @@ export function OpportunityTableList({
opportunity={opportunity}
isLast={isLast}
districtsList={districtsList}
volunteerId={volunteerId}
/>
) : (
<OpportunityReadOnlyTableRow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ interface TableRowProps {
opportunity: ApiVolunteerOpportunityGetList;
isLast: boolean;
districtsList?: OptionItem[];
volunteerId?: string;
}

export function OpportunityTableRow({ opportunity, isLast, districtsList }: TableRowProps) {
export function OpportunityTableRow({ opportunity, isLast, districtsList, volunteerId }: TableRowProps) {
const { t, i18n } = useTranslation();

const ext = opportunity as ExtendedOpportunity;
Expand All @@ -52,7 +53,8 @@ export function OpportunityTableRow({ opportunity, isLast, districtsList }: Tabl
const otherVolunteersCount = numberOfVolunteers && numberOfVolunteers > 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 (
<ClickableRow as={Link} href={profileUrl} $isLast={isLast} data-testid={`opportunity-row-${id}`}>
Expand Down
Loading