mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Added fix for no offer screen (#19092)
This commit is contained in:
parent
2cd248b5bf
commit
0a20df65b5
1 changed files with 3 additions and 2 deletions
|
@ -132,6 +132,7 @@ export const OffersIndexModal = () => {
|
||||||
});
|
});
|
||||||
const {data: {tiers: allTiers} = {}} = useBrowseTiers();
|
const {data: {tiers: allTiers} = {}} = useBrowseTiers();
|
||||||
const paidActiveTiers = getPaidActiveTiers(allTiers || []);
|
const paidActiveTiers = getPaidActiveTiers(allTiers || []);
|
||||||
|
const activeOffers = allOffers.filter(offer => offer.status === 'active');
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!hasOffers) {
|
if (!hasOffers) {
|
||||||
|
@ -233,7 +234,7 @@ export const OffersIndexModal = () => {
|
||||||
animate={false}
|
animate={false}
|
||||||
cancelLabel=''
|
cancelLabel=''
|
||||||
footer={
|
footer={
|
||||||
allOffers.length > 0 ?
|
activeOffers.length > 0 ?
|
||||||
<div className='mx-8 flex w-full items-center justify-between'>
|
<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>
|
<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={() => {
|
<Button color='black' label='Close' onClick={() => {
|
||||||
|
@ -249,7 +250,7 @@ export const OffersIndexModal = () => {
|
||||||
testId='offers-modal'
|
testId='offers-modal'
|
||||||
stickyFooter
|
stickyFooter
|
||||||
>
|
>
|
||||||
{allOffers.length > 0 ?
|
{activeOffers.length > 0 ?
|
||||||
<div className='pt-6'>
|
<div className='pt-6'>
|
||||||
<header>
|
<header>
|
||||||
<div className='flex items-center justify-between'>
|
<div className='flex items-center justify-between'>
|
||||||
|
|
Loading…
Add table
Reference in a new issue