this repo has no description
0
fork

Configure Feed

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

fix embed edge case

+25 -15
+1
apps/expo/src/app/_layout.tsx
··· 113 113 <Stack 114 114 screenOptions={{ 115 115 headerShown: true, 116 + headerBackTitle: "", 116 117 headerStyle: { 117 118 backgroundColor: "#fff", 118 119 },
+13 -8
apps/expo/src/components/embed.tsx
··· 49 49 } 50 50 51 51 export const Embed = ({ content, truncate = true }: Props) => { 52 + console.log(JSON.stringify(content, null, 2)); 52 53 try { 53 54 // Case 1: Image 54 55 if (AppBskyEmbedImages.isView(content)) { ··· 101 102 assert(AppBskyFeedPost.validateRecord(record.value)); 102 103 103 104 return ( 104 - <PostEmbed author={record.author} uri={record.uri}> 105 - <Text 106 - className="mt-1 text-base leading-5" 107 - numberOfLines={truncate ? 4 : undefined} 108 - > 109 - {record.value.text} 110 - </Text> 105 + <> 111 106 {media && <Embed content={media} />} 112 - </PostEmbed> 107 + <PostEmbed author={record.author} uri={record.uri}> 108 + <Text 109 + className="mt-1 text-base leading-5" 110 + numberOfLines={truncate ? 4 : undefined} 111 + > 112 + {record.value.text} 113 + </Text> 114 + {/* in what case will there be more than one? in what order do we show them? */} 115 + {record.embeds && <Embed content={record.embeds[0]} />} 116 + </PostEmbed> 117 + </> 113 118 ); 114 119 } 115 120
+3 -3
apps/expo/src/components/feed-post.tsx
··· 1 - import { Image, Pressable, Text, TouchableOpacity, View } from "react-native"; 1 + import { Image, Text, TouchableOpacity, View } from "react-native"; 2 2 import { Link } from "expo-router"; 3 3 import { AppBskyFeedDefs, AppBskyFeedPost } from "@atproto/api"; 4 4 import { Heart, MessageSquare, Repeat, User } from "lucide-react-native"; ··· 145 145 146 146 return ( 147 147 <Link href={`/profile/${item.reason.by.handle}`} asChild> 148 - <Pressable className="mb-1 ml-12 flex-1 flex-row items-center"> 148 + <TouchableOpacity className="mb-1 ml-12 flex-1 flex-row items-center"> 149 149 <Repeat color="#1C1C1E" size={12} /> 150 150 <Text className="ml-2 flex-1 text-sm" numberOfLines={1}> 151 151 Reposted by {item.reason.by.displayName ?? item.reason.by.handle} 152 152 </Text> 153 - </Pressable> 153 + </TouchableOpacity> 154 154 </Link> 155 155 ); 156 156 };
+8 -4
apps/expo/src/components/profile-view.tsx
··· 62 62 <Stack.Screen 63 63 options={{ 64 64 headerTitle: "", 65 - headerBackTitleVisible: false, 65 + headerTransparent: true, 66 + headerStyle: { 67 + backgroundColor: atTop ? "transparent" : undefined, 68 + }, 66 69 }} 67 70 /> 68 - <Stack.Screen options={{ headerTitle: "Post" }} /> 69 71 <ActivityIndicator /> 70 72 </View> 71 73 ); ··· 75 77 <Stack.Screen 76 78 options={{ 77 79 headerTitle: "", 78 - headerBackTitleVisible: false, 80 + headerTransparent: true, 81 + headerStyle: { 82 + backgroundColor: atTop ? "transparent" : undefined, 83 + }, 79 84 }} 80 85 /> 81 86 <Text className="text-center text-xl"> ··· 90 95 options={{ 91 96 headerTransparent: true, 92 97 headerTitle: "", 93 - headerBackTitleVisible: false, 94 98 ...(!atTop 95 99 ? { 96 100 headerBlurEffect: "systemThinMaterialLight",