Added fix for no offer screen (#19092)

This commit is contained in:
Princi Vershwal 2023-11-22 16:05:40 +05:30 committed by GitHub
parent 2cd248b5bf
commit 0a20df65b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -132,6 +132,7 @@ export const OffersIndexModal = () => {
});
const {data: {tiers: allTiers} = {}} = useBrowseTiers();
const paidActiveTiers = getPaidActiveTiers(allTiers || []);
const activeOffers = allOffers.filter(offer => offer.status === 'active');
useEffect(() => {
if (!hasOffers) {
@ -233,7 +234,7 @@ export const OffersIndexModal = () => {
animate={false}
cancelLabel=''
footer={
allOffers.length > 0 ?
activeOffers.length > 0 ?
<div className='mx-8 flex w-full items-center justify-between'>
<a className='text-sm' href="https://ghost.org/help/offers" rel="noopener noreferrer" target="_blank"> Learn about offers in Ghost</a>
<Button color='black' label='Close' onClick={() => {
@ -249,7 +250,7 @@ export const OffersIndexModal = () => {
testId='offers-modal'
stickyFooter
>
{allOffers.length > 0 ?
{activeOffers.length > 0 ?
<div className='pt-6'>
<header>
<div className='flex items-center justify-between'>