Fix up mobile

This commit is contained in:
Eric Bailey
2026-05-22 17:24:45 -05:00
parent 6ffe4d2456
commit f3de5ccdda
2 changed files with 33 additions and 10 deletions
@@ -12,14 +12,19 @@ import {
matchStandardSitePublisher, matchStandardSitePublisher,
matchStandardSitePublisherByUri, matchStandardSitePublisherByUri,
} from '#/components/Post/Embed/StandardSiteEmbed/publishers' } from '#/components/Post/Embed/StandardSiteEmbed/publishers'
import {isStandardSiteDocumentUri} from '#/components/Post/Embed/StandardSiteEmbed/utils' import {
isStandardSiteDocumentUri,
isStandardSitePublicationUri,
} from '#/components/Post/Embed/StandardSiteEmbed/utils'
import {Text} from '#/components/Typography' import {Text} from '#/components/Typography'
export function PublicationMetaRow({ export function StandardSiteMetaRow({
type = 'document',
view, view,
onInteractWithin, onInteractWithin,
onInteractWithout, onInteractWithout,
}: { }: {
type?: 'document' | 'publication'
view: AppBskyEmbedExternal.ViewExternal view: AppBskyEmbedExternal.ViewExternal
onInteractWithin: () => void onInteractWithin: () => void
onInteractWithout: () => void onInteractWithout: () => void
@@ -29,7 +34,11 @@ export function PublicationMetaRow({
const highlightedPublisher = !!matchStandardSitePublisher(view) const highlightedPublisher = !!matchStandardSitePublisher(view)
const didsFromRecords = const didsFromRecords =
view.associatedRefs view.associatedRefs
?.filter(isStandardSiteDocumentUri) ?.filter(
type === 'document'
? isStandardSiteDocumentUri
: isStandardSitePublicationUri,
)
.map(ref => new AtUri(ref.uri).host) || [] .map(ref => new AtUri(ref.uri).host) || []
// atm should only be one docment // atm should only be one docment
const authorDid = didsFromRecords.at(0) const authorDid = didsFromRecords.at(0)
@@ -16,8 +16,8 @@ import {useInteractionState} from '#/components/hooks/useInteractionState'
import {Clock_Stroke2_Corner0_Rounded as Clock} from '#/components/icons/Clock' import {Clock_Stroke2_Corner0_Rounded as Clock} from '#/components/icons/Clock'
import {Link} from '#/components/Link' import {Link} from '#/components/Link'
import {MediaInsetBorder} from '#/components/MediaInsetBorder' import {MediaInsetBorder} from '#/components/MediaInsetBorder'
import {PublicationMetaRow} from '#/components/Post/Embed/StandardSiteEmbed/PublicationMetaRow'
import {matchStandardSitePublisher} from '#/components/Post/Embed/StandardSiteEmbed/publishers' import {matchStandardSitePublisher} from '#/components/Post/Embed/StandardSiteEmbed/publishers'
import {StandardSiteMetaRow} from '#/components/Post/Embed/StandardSiteEmbed/StandardSiteMetaRow'
import {StandardSiteThemeProvider} from '#/components/Post/Embed/StandardSiteEmbed/StandardSiteThemeProvider' import {StandardSiteThemeProvider} from '#/components/Post/Embed/StandardSiteEmbed/StandardSiteThemeProvider'
import {isStandardSitePublicationEmbed} from '#/components/Post/Embed/StandardSiteEmbed/utils' import {isStandardSitePublicationEmbed} from '#/components/Post/Embed/StandardSiteEmbed/utils'
import {Text} from '#/components/Typography' import {Text} from '#/components/Typography'
@@ -107,7 +107,7 @@ export const StandardSiteEmbed = ({
<View <View
style={[ style={[
a.flex_col, a.flex_col,
a.rounded_md, a.rounded_lg,
a.overflow_hidden, a.overflow_hidden,
a.w_full, a.w_full,
a.border, a.border,
@@ -218,7 +218,7 @@ export const StandardSiteEmbed = ({
<View style={[a.px_md]}> <View style={[a.px_md]}>
<Divider /> <Divider />
<View style={[a.py_sm]}> <View style={[a.py_sm]}>
<PublicationMetaRow <StandardSiteMetaRow
view={view} view={view}
onInteractWithin={onInteractWithin} onInteractWithin={onInteractWithin}
onInteractWithout={onInteractWithout} onInteractWithout={onInteractWithout}
@@ -242,6 +242,7 @@ export const StandardSiteEmbed = ({
onPress={onPress} onPress={onPress}
onLongPress={onLongPress} onLongPress={onLongPress}
themeColors={themeColors} themeColors={themeColors}
hideSubscribe={hideSubscribe}
/> />
</> </>
)} )}
@@ -288,7 +289,7 @@ export function PublicationCard({
<View <View
style={[ style={[
a.flex_col, a.flex_col,
a.rounded_md, a.rounded_lg,
a.overflow_hidden, a.overflow_hidden,
a.w_full, a.w_full,
a.border, a.border,
@@ -330,7 +331,8 @@ export function PublicationCard({
]}> ]}>
{view.source?.title} {view.source?.title}
</Text> </Text>
<PublicationMetaRow <StandardSiteMetaRow
type="publication"
view={view} view={view}
onInteractWithin={onInteractWithin} onInteractWithin={onInteractWithin}
onInteractWithout={onInteractWithout} onInteractWithout={onInteractWithout}
@@ -338,7 +340,7 @@ export function PublicationCard({
</View> </View>
</View> </View>
{!hideSubscribe && ( {!hideSubscribe && gtPhone && (
<SubscribeButton <SubscribeButton
view={view} view={view}
style={[!gtPhone && [a.w_full, a.justify_center]]} style={[!gtPhone && [a.w_full, a.justify_center]]}
@@ -355,6 +357,17 @@ export function PublicationCard({
</Text> </Text>
</View> </View>
)} )}
{!hideSubscribe && !gtPhone && (
<View style={[view.description && a.pt_sm]}>
<SubscribeButton
view={view}
style={[!gtPhone && [a.w_full, a.justify_center]]}
onPress={onPress}
onLongPress={onLongPress}
/>
</View>
)}
</View> </View>
) )
}} }}
@@ -544,7 +557,8 @@ export function PublicationFooter({
]}> ]}>
{view.source?.title} {view.source?.title}
</Text> </Text>
<PublicationMetaRow <StandardSiteMetaRow
type="publication"
view={view} view={view}
onInteractWithin={onInteractWithin} onInteractWithin={onInteractWithin}
onInteractWithout={onInteractWithout} onInteractWithout={onInteractWithout}