Skip to content

Commit

Permalink
fix: BF banner showing up for users with existing plan
Browse files Browse the repository at this point in the history
  • Loading branch information
abaicus committed Nov 26, 2024
1 parent 1360216 commit af7645e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions assets/src/dashboard/parts/connected/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,23 @@ const ConnectedLayout = ({
hasApplication,
hasConflicts,
siteSettings,
extraVisits
extraVisits,
plan
} = useSelect( select => {
const {
isConnected,
hasApplication,
getConflicts,
getSiteSettings
getSiteSettings,
getUserData
} = select( 'optimole' );

const conflicts = getConflicts();
const siteSettings = getSiteSettings();
const user = getUserData();

return {
plan: user?.plan,
isConnected: isConnected(),
hasApplication: hasApplication(),
hasConflicts: 0 < conflicts.count || 0,
Expand Down Expand Up @@ -144,9 +148,11 @@ const ConnectedLayout = ({
}
}, [ canSave ]);

const showBFBanner = 'free' === plan && optimoleDashboardApp?.bf_notices?.banner;

return (
<div className="optml-connected 2xl:max-w-screen-xl max-w-screen px-4 mx-auto">
{optimoleDashboardApp?.bf_notices?.banner && <BlackFridayBanner/>}
{showBFBanner && <BlackFridayBanner/>}

<div className="flex flex-col xl:flex-row mx-auto gap-5">
<div
Expand Down

0 comments on commit af7645e

Please sign in to comment.