Skip to content

Commit

Permalink
Show switch only to both campaign and solidarity places detail page (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucieo authored Mar 4, 2024
1 parent a63000a commit 85bac44
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions web/components/Campaign/Places/Detail/CampaignPlaceDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ const CampaignPlaceDetail = ({ place }: Props) => {
)
}, [place])

const { campaignDispos, solidarityDisposNum } = useCampaignDispo(
place?.disponibilities,
)
const {
campaignDispos,
solidarityDisposNum,
campaignDisposNum,
} = useCampaignDispo(place?.disponibilities)

return (
<Box>
Expand Down Expand Up @@ -81,7 +83,9 @@ const CampaignPlaceDetail = ({ place }: Props) => {
<PlaceDetailCalendar place={place} />
)}

<CampaignDetailSwitcher isCampaignTab={isCampaignTab} />
{Boolean(solidarityDisposNum && campaignDispos) && (
<CampaignDetailSwitcher isCampaignTab={isCampaignTab} />
)}

{isMobile && (
<PlaceAttributesGridMobile
Expand Down

0 comments on commit 85bac44

Please sign in to comment.