From 21b49a301ebbdc2507b3a135e63de65796c63944 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Thu, 11 Jun 2026 14:17:57 +0300 Subject: [PATCH] make standardsiteembed peekable --- eslint-suppressions.json | 3 - .../Post/Embed/StandardSiteEmbed/index.tsx | 216 ++++++++++-------- src/lib/hooks/useOpenLink.ts | 4 +- 3 files changed, 125 insertions(+), 98 deletions(-) diff --git a/eslint-suppressions.json b/eslint-suppressions.json index e1e981fd08..01fe4e7266 100644 --- a/eslint-suppressions.json +++ b/eslint-suppressions.json @@ -976,9 +976,6 @@ } }, "src/lib/hooks/useOpenLink.ts": { - "@typescript-eslint/no-floating-promises": { - "count": 2 - }, "@typescript-eslint/require-await": { "count": 1 } diff --git a/src/components/Post/Embed/StandardSiteEmbed/index.tsx b/src/components/Post/Embed/StandardSiteEmbed/index.tsx index dc60db53ad..64e93e4c68 100644 --- a/src/components/Post/Embed/StandardSiteEmbed/index.tsx +++ b/src/components/Post/Embed/StandardSiteEmbed/index.tsx @@ -127,7 +127,6 @@ export const StandardSiteEmbed = ({ style={[ a.flex_col, a.rounded_lg, - a.overflow_hidden, a.w_full, a.border, t.atoms.bg, @@ -135,126 +134,149 @@ export const StandardSiteEmbed = ({ preview && a.pointer_events_none, style, ]}> + {/* + * The article is an in-flow `Link` wrapping the content so the iOS peek + * menu has something to lift. The publication footer below lives outside + * it - it has its own link (to the publication) and Subscribe button, so + * it can't be nested inside the article's peek. + */} - <> - - - - {imageUri ? ( - - ) : undefined} - - + {() => ( - - {view.title} - - {view.description ? ( - - {view.description} - + {imageUri ? ( + ) : undefined} - {isStandard && (view.createdAt || view.readingTime) && ( + - {view.createdAt && ( + style={[ + a.pb_xs, + a.px_md, + {gap: 3}, + isStandard && [{gap: 5}, a.pb_sm], + ]}> + + {view.title} + + {view.description ? ( - {niceDate(i18n, view.createdAt, 'long', 'none')} + emoji + numberOfLines={view.thumb ? 2 : 4} + style={[a.text_sm, a.leading_snug]}> + {view.description} - )} - {view.readingTime && ( - - - - {l({ - message: plural(view.readingTime, { - one: '#m', - other: '#m', - }), - comment: `How long it takes to read an article, in minutes. Displayed in a short form, e.g. "5m" for 5 minutes.`, - })} - + ) : undefined} + + {isStandard && (view.createdAt || view.readingTime) && ( + + {view.createdAt && ( + + {niceDate(i18n, view.createdAt, 'long', 'none')} + + )} + {view.readingTime && ( + + + + {l({ + message: plural(view.readingTime, { + one: '#m', + other: '#m', + }), + comment: `How long it takes to read an article, in minutes. Displayed in a short form, e.g. "5m" for 5 minutes.`, + })} + + + )} )} + + + {!view.source && ( + + + + + + )} - - - {!view.source && ( - - - - - - )} - + {view.source && ( - + { if (__DEV__) logger.error('Could not open web browser', {message: err}) - Linking.openURL(url) + void Linking.openURL(url) }) return } } - Linking.openURL(url) + void Linking.openURL(url) }, [ax, enabled, inAppBrowserConsentControl, t, dialogContext], )