Bluesky app fork with some witchin' additions 💫 witchsky.app
bluesky fork client
117
fork

Configure Feed

Select the types of activity you want to include in your feed.

Squash carousel in chat messages, fix rounding (#10286)

authored by

Eric Bailey and committed by
GitHub
587dc8df 43108533

+17 -20
+6 -10
src/components/Post/Embed/index.tsx
··· 39 39 import { 40 40 type CommonProps, 41 41 type EmbedProps, 42 - PostEmbedViewContext, 43 - QuoteEmbedViewContext, 42 + type PostEmbedViewContext, 44 43 } from './types' 45 44 import {VideoEmbed} from './VideoEmbed' 46 45 47 - export {PostEmbedViewContext, QuoteEmbedViewContext} from './types' 46 + export {PostEmbedViewContext} from './types' 48 47 49 48 export function Embed({embed: rawEmbed, ...rest}: EmbedProps) { 50 49 const embed = parseEmbed(rawEmbed) ··· 164 163 <QuoteEmbed 165 164 {...rest} 166 165 embed={embed} 167 - viewContext={ 168 - rest.viewContext === PostEmbedViewContext.Feed 169 - ? QuoteEmbedViewContext.FeedEmbedRecordWithMedia 170 - : undefined 171 - } 166 + viewContext={rest.viewContext} 172 167 isWithinQuote={rest.isWithinQuote} 173 168 allowNestedQuotes={rest.allowNestedQuotes} 174 169 /> ··· 229 224 linkDisabled, 230 225 isWithinQuote: parentIsWithinQuote, 231 226 allowNestedQuotes: parentAllowNestedQuotes, 227 + viewContext, 232 228 }: Omit<CommonProps, 'viewContext'> & { 233 229 embed: EmbedType<'post'> 234 - viewContext?: QuoteEmbedViewContext 230 + viewContext?: PostEmbedViewContext 235 231 linkDisabled?: boolean 236 232 }) { 237 233 const moderationOpts = useModerationOpts() ··· 309 305 <Embed 310 306 embed={quote.embed} 311 307 moderation={moderation} 312 - viewContext={PostEmbedViewContext.FeedEmbedRecordWithMedia} 308 + viewContext={viewContext} 313 309 isWithinQuote={parentIsWithinQuote ?? true} 314 310 // already within quote? override nested 315 311 allowNestedQuotes={
+1 -4
src/components/Post/Embed/types.ts
··· 5 5 ThreadHighlighted = 'ThreadHighlighted', 6 6 Feed = 'Feed', 7 7 FeedEmbedRecordWithMedia = 'FeedEmbedRecordWithMedia', 8 - } 9 - 10 - export enum QuoteEmbedViewContext { 11 - FeedEmbedRecordWithMedia = PostEmbedViewContext.FeedEmbedRecordWithMedia, 8 + ChatMessage = 'ChatMessage', 12 9 } 13 10 14 11 export type CommonProps = {
+2 -2
src/components/dms/MessageItemEmbed.tsx
··· 30 30 style={[ 31 31 !isFromSelf && a.ml_sm, 32 32 t.atoms.bg, 33 - a.rounded_md, 34 33 native({ 35 34 flexBasis: 0, 36 35 width: Math.min(screen.width, 600) / 1.4, ··· 48 47 <Embed 49 48 embed={embed} 50 49 allowNestedQuotes 51 - viewContext={PostEmbedViewContext.Feed} 50 + viewContext={PostEmbedViewContext.ChatMessage} 52 51 style={[ 53 52 a.rounded_xl, 53 + a.overflow_hidden, 54 54 a.border_0, 55 55 isFromSelf 56 56 ? {
+8 -4
src/components/images/Gallery/index.tsx
··· 103 103 const largeAltBadge = useLargeAltBadgeEnabled() 104 104 const bps = useBreakpoints() 105 105 const window = useWindowDimensions() 106 + const isWithinQuote = 107 + viewContext === PostEmbedViewContext.FeedEmbedRecordWithMedia 108 + const isWithinChat = viewContext === PostEmbedViewContext.ChatMessage 109 + const hideBadges = isWithinQuote 106 110 const contentHeight = useMemo(() => { 111 + if (isWithinChat) { 112 + return 120 113 + } 107 114 if (bps.gtMobile) { 108 115 return 300 109 116 } else if (bps.gtPhone) { ··· 111 118 } else { 112 119 return 200 113 120 } 114 - }, [bps]) 115 - const isWithinQuote = 116 - viewContext === PostEmbedViewContext.FeedEmbedRecordWithMedia 117 - const hideBadges = isWithinQuote 121 + }, [bps, isWithinChat]) 118 122 119 123 /* 120 124 * Container overflow styles