Paginated Campaign Gallery
The PaginatedCampaignGallery component will display a paginated gallery of 'website' campaigns queried via GraphQL.
Hide Campaigns
If the DS_ENABLE_HIDE_CAMPAIGNS feature flag is enabled, Group Campaigns (Campaigns with a group_type_id field assigned), will not be displayed in the gallery. Additionally, a custom list of Campaign IDs can be assigned via the DS_HIDE_CAMPAIGN_IDS site config variable, and Campaigns with matching IDs also be rejected.
Usage Instructions
The PaginatedCampaignGallery accepts a list of variables used to optionally filter and sort the campaigns:
An array of
causesStrings to filter for campaigns including the listed causesan
isOpenBoolean to determine filtering for open or closed campaignsan
orderBy(comma separated) String to program the sorting ('id,desc')a
firstinteger to determine how many campaigns to pull at a time
Additionally, it accepts a couple of gallery specific props:
itemsPerRow(optional)
title
<PaginatedCampaignGallery
className="grid-full"
itemsPerRow={4}
title="Campaigns"
variables={{ isOpen: true, first: 12, causes: [slug] }}
/>
Last updated