[APP-2160] Stabilize avatar style and drop stray Fragments
Hoist the publication avatar style to a module-level const so its identity is stable across renders, and remove two empty Fragment wrappers that served no purpose.
This commit is contained in:
@@ -33,6 +33,10 @@ export type ThemeColors = {
|
|||||||
accentForeground: string
|
accentForeground: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const PUBLICATION_AVATAR_STYLE = {
|
||||||
|
borderRadius: a.rounded_sm.borderRadius,
|
||||||
|
}
|
||||||
|
|
||||||
export function useStandardSitePublisherConfig(
|
export function useStandardSitePublisherConfig(
|
||||||
view: AppBskyEmbedExternal.ViewExternal,
|
view: AppBskyEmbedExternal.ViewExternal,
|
||||||
) {
|
) {
|
||||||
@@ -365,32 +369,30 @@ export function PublicationCard({
|
|||||||
a.gap_sm,
|
a.gap_sm,
|
||||||
gtPhone && a.flex_1,
|
gtPhone && a.flex_1,
|
||||||
]}>
|
]}>
|
||||||
<>
|
<PublicationIcon
|
||||||
<PublicationIcon
|
view={view}
|
||||||
|
size={40}
|
||||||
|
hovered={hovered}
|
||||||
|
themeColors={themeColors}
|
||||||
|
/>
|
||||||
|
<View style={[a.flex_1, a.gap_2xs]}>
|
||||||
|
<Text
|
||||||
|
numberOfLines={1}
|
||||||
|
style={[
|
||||||
|
a.text_md,
|
||||||
|
a.font_semi_bold,
|
||||||
|
t.atoms.text,
|
||||||
|
hovered && a.underline,
|
||||||
|
]}>
|
||||||
|
{view.source?.title}
|
||||||
|
</Text>
|
||||||
|
<PublicationMetaRow
|
||||||
view={view}
|
view={view}
|
||||||
size={40}
|
author={author}
|
||||||
hovered={hovered}
|
onInteractWithin={onInteractWithin}
|
||||||
themeColors={themeColors}
|
onInteractWithout={onInteractWithout}
|
||||||
/>
|
/>
|
||||||
<View style={[a.flex_1, a.gap_2xs]}>
|
</View>
|
||||||
<Text
|
|
||||||
numberOfLines={1}
|
|
||||||
style={[
|
|
||||||
a.text_md,
|
|
||||||
a.font_semi_bold,
|
|
||||||
t.atoms.text,
|
|
||||||
hovered && a.underline,
|
|
||||||
]}>
|
|
||||||
{view.source?.title}
|
|
||||||
</Text>
|
|
||||||
<PublicationMetaRow
|
|
||||||
view={view}
|
|
||||||
author={author}
|
|
||||||
onInteractWithin={onInteractWithin}
|
|
||||||
onInteractWithout={onInteractWithout}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
</>
|
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
{!hideSubscribe && (
|
{!hideSubscribe && (
|
||||||
@@ -482,7 +484,7 @@ function PublicationIcon({
|
|||||||
type="labeler"
|
type="labeler"
|
||||||
size={size}
|
size={size}
|
||||||
avatar={view.source.icon}
|
avatar={view.source.icon}
|
||||||
extraAviStyle={{borderRadius: a.rounded_sm.borderRadius}}
|
extraAviStyle={PUBLICATION_AVATAR_STYLE}
|
||||||
/>
|
/>
|
||||||
<MediaInsetBorder
|
<MediaInsetBorder
|
||||||
style={[
|
style={[
|
||||||
@@ -579,32 +581,30 @@ export function PublicationFooter({
|
|||||||
a.gap_sm,
|
a.gap_sm,
|
||||||
gtPhone && a.flex_1,
|
gtPhone && a.flex_1,
|
||||||
]}>
|
]}>
|
||||||
<>
|
<PublicationIcon
|
||||||
<PublicationIcon
|
view={view}
|
||||||
|
size={32}
|
||||||
|
hovered={hovered}
|
||||||
|
themeColors={themeColors}
|
||||||
|
/>
|
||||||
|
<View style={[a.flex_1, a.gap_2xs]}>
|
||||||
|
<Text
|
||||||
|
numberOfLines={1}
|
||||||
|
style={[
|
||||||
|
a.text_sm,
|
||||||
|
a.font_medium,
|
||||||
|
t.atoms.text,
|
||||||
|
hovered && a.underline,
|
||||||
|
]}>
|
||||||
|
{view.source?.title}
|
||||||
|
</Text>
|
||||||
|
<PublicationMetaRow
|
||||||
view={view}
|
view={view}
|
||||||
size={32}
|
author={author}
|
||||||
hovered={hovered}
|
onInteractWithin={onInteractWithin}
|
||||||
themeColors={themeColors}
|
onInteractWithout={onInteractWithout}
|
||||||
/>
|
/>
|
||||||
<View style={[a.flex_1, a.gap_2xs]}>
|
</View>
|
||||||
<Text
|
|
||||||
numberOfLines={1}
|
|
||||||
style={[
|
|
||||||
a.text_sm,
|
|
||||||
a.font_medium,
|
|
||||||
t.atoms.text,
|
|
||||||
hovered && a.underline,
|
|
||||||
]}>
|
|
||||||
{view.source?.title}
|
|
||||||
</Text>
|
|
||||||
<PublicationMetaRow
|
|
||||||
view={view}
|
|
||||||
author={author}
|
|
||||||
onInteractWithin={onInteractWithin}
|
|
||||||
onInteractWithout={onInteractWithout}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
</>
|
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
{!hideSubscribe && (
|
{!hideSubscribe && (
|
||||||
|
|||||||
Reference in New Issue
Block a user