Skip to content

Commit

Permalink
Align remove buttons
Browse files Browse the repository at this point in the history
Remove the implicit top padding in record embeds and make it conditional, which is similar to how we treat external link embeds. This makes the X button appear in the same place for record embeds as with links.
  • Loading branch information
gaearon committed Oct 21, 2024
1 parent c79642d commit 65c9735
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/components/StarterPack/StarterPackCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ export function Embed({
return (
<View
style={[
a.mt_xs,
a.border,
a.rounded_sm,
a.overflow_hidden,
Expand Down
1 change: 0 additions & 1 deletion src/view/com/composer/ExternalEmbed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ function Container({
return (
<View
style={[
a.mt_sm,
a.rounded_sm,
a.border,
a.align_center,
Expand Down
20 changes: 15 additions & 5 deletions src/view/com/util/post-embeds/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,29 @@ export function PostEmbeds({
if (AppBskyEmbedRecord.isView(embed)) {
// custom feed embed (i.e. generator view)
if (AppBskyFeedDefs.isGeneratorView(embed.record)) {
return <MaybeFeedCard view={embed.record} />
return (
<View style={a.mt_sm}>
<MaybeFeedCard view={embed.record} />
</View>
)
}

// list embed
if (AppBskyGraphDefs.isListView(embed.record)) {
return <MaybeListCard view={embed.record} />
return (
<View style={a.mt_sm}>
<MaybeListCard view={embed.record} />
</View>
)
}

// starter pack embed
if (AppBskyGraphDefs.isStarterPackViewBasic(embed.record)) {
return <StarterPackCard starterPack={embed.record} />
return (
<View style={a.mt_sm}>
<StarterPackCard starterPack={embed.record} />
</View>
)
}

// quote post
Expand Down Expand Up @@ -238,7 +250,6 @@ export function MaybeListCard({view}: {view: AppBskyGraphDefs.ListView}) {
t.atoms.border_contrast_medium,
a.p_md,
a.rounded_sm,
a.mt_sm,
]}>
<ListCard.Default view={view} />
</View>
Expand All @@ -264,7 +275,6 @@ const styles = StyleSheet.create({
customFeedOuter: {
borderWidth: StyleSheet.hairlineWidth,
borderRadius: 8,
marginTop: 4,
paddingHorizontal: 12,
paddingVertical: 12,
},
Expand Down

0 comments on commit 65c9735

Please sign in to comment.