Live video on the AT Protocol

Merge pull request #980 from streamplace/natb/atmoco-stage-switch

Add stage switching for AtMoCo

authored by

Eli Mallon and committed by
GitHub
bb730e0e f7f722f5

+43
+43
js/app/components/mobile/bottom-metadata.tsx
··· 12 12 useDID, 13 13 useLivestreamInfo, 14 14 useLivestreamStore, 15 + useTheme, 15 16 zero, 16 17 } from "@streamplace/components"; 18 + import AQLink from "components/aqlink"; 17 19 import FollowButton from "components/follow-button"; 18 20 import { Image } from "expo-image"; 19 21 import { ChevronLeft, ChevronRight } from "lucide-react-native"; 20 22 import { Linking, Pressable, View } from "react-native"; 21 23 import { KebabMenu } from "./desktop-ui/kebab"; 22 24 const { gap, px, py, colors } = zero; 25 + 26 + const ATMOCO_STREAMS = [ 27 + { handle: "stream1.atmosphereconf.org", label: "Great Hall" }, 28 + { handle: "stream2.atmosphereconf.org", label: "Performance Theatre" }, 29 + { handle: "stream3.atmosphereconf.org", label: "Room 2301" }, 30 + ]; 31 + 32 + function AtMoCoNav({ currentHandle }: { currentHandle: string }) { 33 + const z = useTheme(); 34 + return ( 35 + <View style={[layout.flex.row, layout.flex.alignCenter, gap.all[2], py[2]]}> 36 + <Text>Switch streams:</Text> 37 + {ATMOCO_STREAMS.map((stream) => { 38 + const isActive = currentHandle === stream.handle; 39 + return ( 40 + <AQLink 41 + key={stream.handle} 42 + to={{ screen: "Stream", params: { user: stream.handle } }} 43 + style={[ 44 + zero.px[3], 45 + isActive 46 + ? { backgroundColor: z.theme.colors.accent } 47 + : zero.borders.width.thin, 48 + , 49 + zero.borders.color.gray[500], 50 + zero.r.full, 51 + ]} 52 + > 53 + <Text>{stream.label}</Text> 54 + </AQLink> 55 + ); 56 + })} 57 + </View> 58 + ); 59 + } 23 60 24 61 export function BottomMetadata({ 25 62 setShowChat, ··· 152 189 )} 153 190 </View> 154 191 )} 192 + 193 + {/* Atmosphere Conference inter-stream navigation. TODO: remove after conf haha */} 194 + {profile?.handle && 195 + ATMOCO_STREAMS.some((s) => s.handle === profile.handle) && ( 196 + <AtMoCoNav currentHandle={profile.handle} /> 197 + )} 155 198 </View> 156 199 ); 157 200 }