diff --git a/js/app/components/container.tsx b/js/app/components/container.tsx index ea44c6a46..aaf92f8d1 100644 --- a/js/app/components/container.tsx +++ b/js/app/components/container.tsx @@ -23,6 +23,7 @@ function getMaxWidth(width: number): number { if (width >= 800) return maxContainerWidths.xl; if (width >= 740) return maxContainerWidths.lg; if (width >= 660) return maxContainerWidths.md; + if (width >= 440) return width; return maxContainerWidths.sm; } @@ -33,6 +34,7 @@ export default function Container({ }: ContainerProps) { const { width } = useWindowDimensions(); const maxWidth = getMaxWidth(width); + const isMobile = width < 768; return ( { const layoutHorizontal = horizontal; + const inMobileMode = horizontal && !showAvatar; const { url } = useStreamplaceNode(); const { theme } = useTheme(); const isWeb = Platform.OS === "web"; @@ -95,8 +98,8 @@ const StreamCard = ({ const contentPaddingHoriz = 12; const contentPaddingVertical = 2.65; const avatarSize = 40; - const livePillHeight = 30; - const livePillPaddingHorizontal = 4; + const livePillHeight = inMobileMode ? 20 : 30; + const livePillPaddingHorizontal = inMobileMode ? 2 : 4; const contentSectionHeight = avatarSize + 2 * contentPaddingVertical; const contentSectionWidth = avatarSize * 2 + contentPaddingHoriz; @@ -123,7 +126,11 @@ const StreamCard = ({ style={[ { flex: layoutHorizontal ? 0 : undefined, - minWidth: layoutHorizontal ? "63%" : "100%", + minWidth: layoutHorizontal + ? inMobileMode + ? "40%" + : "63%" + : "100%", // native seems to be unable to adjust widths properly? maxHeight: !isWeb ? "76.5%" : "100%", position: "relative", @@ -146,8 +153,8 @@ const StreamCard = ({ style={[ { position: "absolute", - top: contentPaddingHoriz, - right: contentPaddingVertical, + top: contentPaddingVertical * 2, + right: contentPaddingVertical * 2, backgroundColor: "rgba(0, 0, 0, 0.75)", borderRadius: 999, borderWidth: 1, @@ -161,7 +168,10 @@ const StreamCard = ({ }, ]} > - + )} @@ -182,42 +192,46 @@ const StreamCard = ({ ]} > {/* Avatar */} - - {/* dynamically switching between these src crashes android */} - {avatarUrl && ( - - - - )} - {!avatarUrl && ( - - - - )} - + {showAvatar && ( + + {/* dynamically switching between these src crashes android */} + {avatarUrl && ( + + + + )} + {!avatarUrl && ( + + + + )} + + )} {/* Text content */} @@ -264,12 +279,13 @@ const StreamCard = ({ {((activity && category.length > 0) || tags.length > 0) && ( { const width = e.nativeEvent?.layout?.width; @@ -283,7 +299,7 @@ const StreamCard = ({ { @@ -300,7 +316,10 @@ const StreamCard = ({ {activity} )} - {tagItems.slice(0, visibleTagCount).map((cat, index) => ( + {(inMobileMode + ? tagItems + : tagItems.slice(0, visibleTagCount) + ).map((cat, index) => ( = 3; const firstRowCols = useHorizontalFirst ? cols - 1 : cols; @@ -336,7 +341,7 @@ export default function HomeScreen({ { flexDirection: "row" }, { gap: 24, - marginBottom: 24, + marginBottom: useHorizontalAll ? 12 : 24, width: "100%", }, ]} @@ -358,7 +363,10 @@ export default function HomeScreen({ item={item} size={size} avatarUrl={avis[item.author.did]?.avatar} - horizontal={itemIndex == 0 && useHorizontalFirst} + horizontal={ + useHorizontalAll || (itemIndex == 0 && useHorizontalFirst) + } + showAvatar={!useHorizontalAll} /> ))} @@ -384,7 +392,7 @@ export default function HomeScreen({ key={`row-${rowIndex}`} style={[ { flexDirection: "row" }, - { gap: 24, marginBottom: 24 }, + { gap: 24, marginBottom: useHorizontalAll ? 12 : 24 }, ]} > {row.map((item, itemIndex) => @@ -397,6 +405,8 @@ export default function HomeScreen({ item={item} size={size} avatarUrl={avis[item.author.did]?.avatar} + horizontal={useHorizontalAll} + showAvatar={!useHorizontalAll} /> ) : ( diff --git a/js/components/src/components/mobile-player/ui/viewers.tsx b/js/components/src/components/mobile-player/ui/viewers.tsx index aea7b81de..688a5d7a6 100644 --- a/js/components/src/components/mobile-player/ui/viewers.tsx +++ b/js/components/src/components/mobile-player/ui/viewers.tsx @@ -9,18 +9,29 @@ export function Viewers() { return ; } -export function DehydratedViewers({ viewers }: { viewers: number }) { +export function DehydratedViewers({ + viewers, + size = "md", +}: { + viewers: number; + size?: "sm" | "md"; +}) { + const iconSize = size === "sm" ? 12 : 24; + const fontSize = size === "sm" ? 11 : 16; return ( - - + + ); } -- 2.51.2 From 1736637e954b17ae69aa75562d1c6d74c24f222d Mon Sep 17 00:00:00 2001 From: Natalie Bridgers Date: Fri, 22 May 2026 20:39:32 -0500 Subject: [PATCH 2/3] more vertical space --- js/app/components/home/cards.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/app/components/home/cards.tsx b/js/app/components/home/cards.tsx index 8eb6e06a2..88beac26f 100644 --- a/js/app/components/home/cards.tsx +++ b/js/app/components/home/cards.tsx @@ -128,7 +128,7 @@ const StreamCard = ({ flex: layoutHorizontal ? 0 : undefined, minWidth: layoutHorizontal ? inMobileMode - ? "40%" + ? "45%" : "63%" : "100%", // native seems to be unable to adjust widths properly? -- 2.51.2 From 1ff8baa1f8e259938c0ddfe246c8d1fba77ae338 Mon Sep 17 00:00:00 2001 From: Natalie Bridgers Date: Thu, 28 May 2026 11:36:40 -0500 Subject: [PATCH 3/3] mobile rows work better now? --- js/app/components/home/cards.tsx | 11 +++--- js/app/src/screens/home.tsx | 66 ++++++++++++++++---------------- 2 files changed, 40 insertions(+), 37 deletions(-) diff --git a/js/app/components/home/cards.tsx b/js/app/components/home/cards.tsx index 88beac26f..630c34e18 100644 --- a/js/app/components/home/cards.tsx +++ b/js/app/components/home/cards.tsx @@ -108,7 +108,7 @@ const StreamCard = ({ s === null) && cols > 0) { - // ensure segs is not just [null] if segments is empty - segs = []; - } + let rows: (PlaceStreamLivestream.LivestreamView | null)[][] = []; - // assemble rows - const rows: (PlaceStreamLivestream.LivestreamView | null)[][] = []; - for (let i = 0; i < cutSegs.length; i += cols) { - let row = cutSegs.slice(i, i + cols); - // pad the last row with nulls if it's not full - if (i + cols >= cutSegs.length && row.length < cols) { - const paddingNeeded = cols - row.length; - row = [...row, ...Array(paddingNeeded).fill(null)]; + if (!useHorizontalAll) { + for (let i = 0; i < cutSegs.length; i += cols) { + let row = cutSegs.slice(i, i + cols); + if (i + cols >= cutSegs.length && row.length < cols) { + const paddingNeeded = cols - row.length; + row = [...row, ...Array(paddingNeeded).fill(null)]; + } + rows.push(row); } - rows.push(row); } const indicatorTop = safeAreaInsets.top; @@ -335,15 +327,28 @@ export default function HomeScreen({ Check back later? )} - {firstRowItems.length > 0 && ( + {useHorizontalAll + ? segments.map((item) => ( + + + + )) + : null} + + {!useHorizontalAll && firstRowItems.length > 0 && ( {firstRowItems.map((item, itemIndex) => ( @@ -363,14 +368,11 @@ export default function HomeScreen({ item={item} size={size} avatarUrl={avis[item.author.did]?.avatar} - horizontal={ - useHorizontalAll || (itemIndex == 0 && useHorizontalFirst) - } - showAvatar={!useHorizontalAll} + horizontal={itemIndex == 0 && useHorizontalFirst} + showAvatar={true} /> ))} - {/* Pad the first row to match the column count */} {Array( useHorizontalFirst ? cols - firstRowItems.length - 1 @@ -385,14 +387,14 @@ export default function HomeScreen({ )} - {segments.length > 0 && ( + {!useHorizontalAll && segments.length > 0 && ( {rows.map((row, rowIndex) => ( {row.map((item, itemIndex) => @@ -405,8 +407,8 @@ export default function HomeScreen({ item={item} size={size} avatarUrl={avis[item.author.did]?.avatar} - horizontal={useHorizontalAll} - showAvatar={!useHorizontalAll} + horizontal={false} + showAvatar={true} /> ) : (