diff --git a/apps/admin-x-design-system/src/assets/icons/tags-block.svg b/apps/admin-x-design-system/src/assets/icons/tags-block.svg new file mode 100644 index 0000000000..febbc688e7 --- /dev/null +++ b/apps/admin-x-design-system/src/assets/icons/tags-block.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/admin-x-settings/src/components/settings/growth/offers/OffersIndex.tsx b/apps/admin-x-settings/src/components/settings/growth/offers/OffersIndex.tsx index 2f2e31cc5e..290a4e12d4 100644 --- a/apps/admin-x-settings/src/components/settings/growth/offers/OffersIndex.tsx +++ b/apps/admin-x-settings/src/components/settings/growth/offers/OffersIndex.tsx @@ -1,7 +1,7 @@ import useFeatureFlag from '../../../../hooks/useFeatureFlag'; import {Button, Tab, TabView} from '@tryghost/admin-x-design-system'; -import {Icon} from '@tryghost/admin-x-design-system'; import {Modal} from '@tryghost/admin-x-design-system'; +import {NoValueLabel} from '@tryghost/admin-x-design-system'; import {SortMenu} from '@tryghost/admin-x-design-system'; import {Tier, useBrowseTiers} from '@tryghost/admin-x-framework/api/tiers'; import {Tooltip} from '@tryghost/admin-x-design-system'; @@ -111,21 +111,6 @@ const OfferCard: React.FC<{amount: number, cadence: string, currency: string, du ); }; -const EmptyScreen: React.FC = () => { - const {updateRoute} = useRouting(); - - return
- -

Provide offers to new signups

-
-

Boost your subscriptions by creating targeted discounts to potential members.

-
-
-
-
; -}; - export const OffersIndexModal = () => { const modal = useModal(); const {updateRoute} = useRouting(); @@ -217,14 +202,17 @@ export const OffersIndexModal = () => { const listLayoutOutput =
- - - - - - - - + {(selectedTab === 'active' && activeOffers.length > 0) || (selectedTab === 'archived' && archivedOffers.length > 0) ? + + + + + + + + : + null + } {sortedOffers.filter((offer) => { const offerTier = allTiers?.find(tier => tier.id === offer?.tier.id); //Check to filter out offers with archived offerTier @@ -262,15 +250,13 @@ export const OffersIndexModal = () => { animate={false} cancelLabel='' footer={ - (activeOffers.length > 0 || archivedOffers.length > 0) ? -
- → Learn about offers in Ghost -
: - false +
+ → Learn about offers in Ghost +
} header={false} height='full' @@ -278,53 +264,59 @@ export const OffersIndexModal = () => { testId='offers-modal' stickyFooter > - {(activeOffers.length > 0 || archivedOffers.length > 0) ? -
-
-
-
- {activeOffers.length > 0 && archivedOffers.length > 0 ? - : - null - } -
-
+
+

{offersTabs.find(tab => tab.id === selectedTab)?.title} offers

+
+ { + const newDirection = selectedDirection === 'asc' ? 'desc' : 'asc'; + setSortDirection(newDirection); + }} + onSortChange={(selectedOption) => { + setSortOption(selectedOption); + }} + />
- { - const newDirection = selectedDirection === 'asc' ? 'desc' : 'asc'; - setSortDirection(newDirection); - }} - onSortChange={(selectedOption) => { - setSortOption(selectedOption); - }} - /> -
-
+
-
- {selectedLayout === 'card' ? cardLayoutOutput : listLayoutOutput} -
: - - } + + + {selectedTab === 'active' && activeOffers.length === 0 ? + + No offers found. + : + null + } + {selectedTab === 'archived' && archivedOffers.length === 0 ? + + No offers found. + : + null + } + {selectedLayout === 'card' ? cardLayoutOutput : listLayoutOutput} + ; };
{sortedOffers.length} {sortedOffers.length > 1 ? 'offers' : 'offer'}TierTermsPriceRedemptions
{sortedOffers.length} {sortedOffers.length > 1 ? 'offers' : 'offer'}TierTermsPriceRedemptions