Skip to content

Commit

Permalink
fix(frontend): stack campaigns in the housing table
Browse files Browse the repository at this point in the history
  • Loading branch information
Falinor committed Jan 15, 2025
1 parent 2925fb6 commit e93fa17
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions frontend/src/components/HousingList/HousingList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,21 +203,25 @@ function HousingList(props: HousingListProps) {
columnHelper.accessor('campaignIds', {
header: 'Campagnes',
cell: ({ cell }) => {
return Set(cell.getValue())
.map((id) => {
return campaignList?.find((campaign) => campaign.id === id);
})
.filter((campaign) => campaign !== undefined)
.map((campaign) => (
<AppLink
key={campaign.id}
isSimple
size="sm"
to={`/campagnes/${campaign.id}`}
>
{`${campaign.title.substring(0, MAX_CAMPAIGN_LENGTH)}${campaign.title.length > MAX_CAMPAIGN_LENGTH ? '...' : ''}`}
</AppLink>
));
return (
<Stack>
{Set(cell.getValue())
.map((id) => {
return campaignList?.find((campaign) => campaign.id === id);
})
.filter((campaign) => campaign !== undefined)
.map((campaign) => (
<AppLink
key={campaign.id}
isSimple
size="sm"
to={`/campagnes/${campaign.id}`}
>
{`${campaign.title.substring(0, MAX_CAMPAIGN_LENGTH)}${campaign.title.length > MAX_CAMPAIGN_LENGTH ? '...' : ''}`}
</AppLink>
))}
</Stack>
);
}
}),
columnHelper.accessor(
Expand Down

0 comments on commit e93fa17

Please sign in to comment.