Skip to content

Commit

Permalink
Updated visibility label copy for HTML card
Browse files Browse the repository at this point in the history
  • Loading branch information
sanne-san committed Nov 19, 2024
1 parent a1cc096 commit f92a426
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions packages/koenig-lexical/src/hooks/useVisibilityToggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,24 @@ export const useVisibilityToggle = (editor, nodeKey, cardConfig) => {
});

if (isVisibilityActive) {
let segmentLabel = '';
let hiddenNewsletter = '';

if (segment === 'status:free') {
segmentLabel = 'free members';
hiddenNewsletter = 'paid newsletter';
} else if (segment === 'status:-free') {
segmentLabel = 'paid members';
hiddenNewsletter = 'free newsletter';
}

if (!showOnWeb && !showOnEmail) {
message = 'Hidden from both web and email';
message = 'Hidden on website and newsletter';
} else if (showOnWeb && !showOnEmail) {
message = 'Only shown on web';
} else if (showOnWeb && showOnEmail && segmentLabel) {
message = `Shown on web, and to ${segmentLabel} only in email`;
} else if (!showOnWeb && showOnEmail && !segmentLabel) {
message = 'Only shown in email';
} else if (!showOnWeb && showOnEmail && segmentLabel) {
message = `Only shown to ${segmentLabel} in email`;
message = 'Hidden in newsletter';
} else if (showOnWeb && showOnEmail && hiddenNewsletter) {
message = `Hidden in ${hiddenNewsletter}`;
} else if (!showOnWeb && showOnEmail && !hiddenNewsletter) {
message = 'Hidden on website';
} else if (!showOnWeb && showOnEmail && hiddenNewsletter) {
message = `Hidden on website and ${hiddenNewsletter}`;
}
}

Expand Down

0 comments on commit f92a426

Please sign in to comment.