Skip to content

Commit 116f28d

Browse files
committed
Removed admin toggle UI changes from backend Share branch
Kept this branch scoped to backend email Share rendering and i18n keys, and clarified context for translators that Share is also used as newsletter feedbackButton buttonText in email footer.
1 parent 9e42e08 commit 116f28d

File tree

6 files changed

+18
-39
lines changed

6 files changed

+18
-39
lines changed

apps/admin-x-framework/src/api/newsletters.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export type Newsletter = {
3030
show_header_name: boolean;
3131
show_post_title_section: boolean;
3232
show_comment_cta: boolean;
33-
show_share_button: boolean;
3433
show_subscription_details: boolean;
3534
show_latest_posts: boolean;
3635
background_color: string;

apps/admin-x-framework/src/test/responses/newsletters.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
"show_header_name": true,
2929
"show_post_title_section": true,
3030
"show_comment_cta": true,
31-
"show_share_button": false,
3231
"show_subscription_details": false,
3332
"show_latest_posts": false,
3433
"background_color": "light",
@@ -77,7 +76,6 @@
7776
"show_header_name": true,
7877
"show_post_title_section": true,
7978
"show_comment_cta": true,
80-
"show_share_button": false,
8179
"show_subscription_details": false,
8280
"show_latest_posts": false,
8381
"background_color": "light",

apps/admin-x-settings/src/components/settings/email/newsletters/newsletter-detail-modal.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -372,12 +372,6 @@ const Sidebar: React.FC<{
372372
label='Add a link to your comments'
373373
onChange={e => updateNewsletter({show_comment_cta: e.target.checked})}
374374
/>}
375-
<Toggle
376-
checked={newsletter.show_share_button}
377-
direction="rtl"
378-
label='Show share button'
379-
onChange={e => updateNewsletter({show_share_button: e.target.checked})}
380-
/>
381375
<Toggle
382376
checked={newsletter.show_latest_posts}
383377
direction="rtl"

apps/admin-x-settings/src/components/settings/email/newsletters/newsletter-preview-content.tsx

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ const NewsletterPreviewContent: React.FC<{
2626
showCommentCta: boolean;
2727
showFeatureImage: boolean;
2828
showFeedback: boolean;
29-
showShareButton: boolean;
3029
showLatestPosts: boolean;
3130
showSubscriptionDetails: boolean;
3231

@@ -71,7 +70,6 @@ const NewsletterPreviewContent: React.FC<{
7170
showCommentCta,
7271
showFeatureImage,
7372
showFeedback,
74-
showShareButton,
7573
showLatestPosts,
7674
showSubscriptionDetails,
7775

@@ -268,40 +266,32 @@ const NewsletterPreviewContent: React.FC<{
268266
</div>
269267

270268
{/* Feedback */}
271-
{(showFeedback || showCommentCta || showShareButton) && (
269+
{(showFeedback || showCommentCta) && (
272270
<div className={clsx('grid gap-5 border-b border-grey-200 px-6 py-5', dividerStyle === 'dashed' && 'border-dashed', dividerStyle === 'dotted' && 'border-b-2 border-dotted')} style={{borderColor: dividerColor}}>
273-
<div className="grid auto-cols-fr grid-flow-col gap-4">
271+
<div className="flex justify-center gap-3">
274272
{showFeedback && (
275273
<>
276-
<div className="pointer-events-none flex min-w-[120px] cursor-default flex-col items-center gap-[11px] text-center">
277-
<span className="inline-flex size-[54px] items-center justify-center rounded-full border" style={{borderColor: dividerColor, color: textColor}}>
274+
<button className="pointer-events-none cursor-default rounded-[2.2rem] bg-transparent font-semibold whitespace-nowrap" type="button">
275+
<span className="inline-flex items-center gap-2 px-[18px] py-[7px]" style={{color: textColor}}>
278276
<Icon colorClass='' name="thumbs-up" size="md" />
277+
<span>More like this</span>
279278
</span>
280-
<span className="font-sans text-[1.3rem] leading-[1.4] font-medium" style={{color: textColor}}>More like this</span>
281-
</div>
282-
<div className="pointer-events-none flex min-w-[120px] cursor-default flex-col items-center gap-[11px] text-center">
283-
<span className="inline-flex size-[54px] items-center justify-center rounded-full border" style={{borderColor: dividerColor, color: textColor}}>
284-
<Icon colorClass='' name="thumbs-down" size="md" />
279+
</button>
280+
<button className="pointer-events-none cursor-default rounded-[2.2rem] bg-transparent font-semibold whitespace-nowrap" type="button">
281+
<span className="inline-flex items-center gap-2 px-[18px] py-[7px]" style={{color: textColor}}>
282+
<Icon colorClass='' name="thumbs-down" />
283+
<span>Less like this</span>
285284
</span>
286-
<span className="font-sans text-[1.3rem] leading-[1.4] font-medium" style={{color: textColor}}>Less like this</span>
287-
</div>
285+
</button>
288286
</>
289287
)}
290288
{showCommentCta && (
291-
<div className="pointer-events-none flex min-w-[120px] cursor-default flex-col items-center gap-[11px] text-center">
292-
<span className="inline-flex size-[54px] items-center justify-center rounded-full border" style={{borderColor: dividerColor, color: textColor}}>
293-
<Icon colorClass='' name="comment" size="md" />
289+
<button className="pointer-events-none cursor-default rounded-[2.2rem] bg-transparent font-semibold whitespace-nowrap" type="button">
290+
<span className="inline-flex items-center gap-2 px-[18px] py-[7px]" style={{color: textColor}}>
291+
<Icon colorClass='' name="comment" />
292+
<span>Comment</span>
294293
</span>
295-
<span className="font-sans text-[1.3rem] leading-[1.4] font-medium" style={{color: textColor}}>Comment</span>
296-
</div>
297-
)}
298-
{showShareButton && (
299-
<div className="pointer-events-none flex min-w-[120px] cursor-default flex-col items-center gap-[11px] text-center">
300-
<span className="inline-flex size-[54px] items-center justify-center rounded-full border" style={{borderColor: dividerColor, color: textColor}}>
301-
<Icon colorClass='' name="share" size="md" />
302-
</span>
303-
<span className="font-sans text-[1.3rem] leading-[1.4] font-medium" style={{color: textColor}}>Share</span>
304-
</div>
294+
</button>
305295
)}
306296
</div>
307297
</div>

apps/admin-x-settings/src/components/settings/email/newsletters/newsletter-preview.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const NewsletterPreview: React.FC<{newsletter: Newsletter}> = ({newsletter}) =>
2121

2222
const showCommentCta = newsletter.show_comment_cta && commentsEnabled !== 'off';
2323
const showFeedback = newsletter.feedback_enabled;
24-
const showShareButton = newsletter.show_share_button;
2524

2625
const backgroundColor = () => {
2726
const value = newsletter.background_color;
@@ -208,7 +207,6 @@ const NewsletterPreview: React.FC<{newsletter: Newsletter}> = ({newsletter}) =>
208207
showFeedback={showFeedback}
209208
showLatestPosts={newsletter.show_latest_posts}
210209
showPostTitleSection={newsletter.show_post_title_section}
211-
showShareButton={showShareButton}
212210
showSubscriptionDetails={newsletter.show_subscription_details}
213211
siteTitle={title}
214212
titleAlignment={newsletter.title_alignment}

ghost/i18n/locales/context.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@
245245
"Sending...": "A loading status message when an email is being sent",
246246
"Sent": "Button text when a comment was reported succesfully",
247247
"Sent to {email}": "Magic link email footer",
248-
"Share": "Title of Portal share modal for sharing a post",
248+
"Share": "Title of Portal share modal for sharing a post, and label for the newsletter email footer Share button text passed as buttonText to the feedbackButton partial",
249249
"Show": "Context menu action for a comment, for administrators - smaller devices",
250250
"Show 1 more reply": "Button text to load the last remaining reply for a comment",
251251
"Show all": "Show all recommendations",
@@ -420,4 +420,4 @@
420420
"{months} months free": "Retention offer discount badge shown during subscription cancellation",
421421
"{trialDays} days free": "Portal - label for a free trial that lasts a specific number of days",
422422
"{years} years": "Duration label for a multiple-year subscription"
423-
}
423+
}

0 commit comments

Comments
 (0)