this repo has no description
0
fork

Configure Feed

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

remove json dump from notifications page

+81 -71
+81 -71
apps/expo/src/app/(tabs)/notifications.tsx
··· 1 - import { ActivityIndicator, Text, View } from "react-native"; 2 - import { Stack } from "expo-router"; 3 - import { FlashList } from "@shopify/flash-list"; 4 - import { useInfiniteQuery } from "@tanstack/react-query"; 1 + // import { ActivityIndicator, Text, View } from "react-native"; 2 + // import { Stack } from "expo-router"; 3 + // import { FlashList } from "@shopify/flash-list"; 4 + // import { useInfiniteQuery } from "@tanstack/react-query"; 5 5 6 - import { Button } from "../../components/button"; 7 - import { useAuthedAgent } from "../../lib/agent"; 6 + // import { Button } from "../../components/button"; 7 + // import { useAuthedAgent } from "../../lib/agent"; 8 8 9 - export default function NotificationsPage() { 10 - const agent = useAuthedAgent(); 11 - const notifications = useInfiniteQuery({ 12 - queryKey: ["notifications"], 13 - queryFn: async ({ pageParam }) => { 14 - const notifs = await agent.listNotifications({ 15 - cursor: pageParam as string | undefined, 16 - }); 17 - return notifs.data; 18 - }, 19 - getNextPageParam: (lastPage) => lastPage.cursor, 20 - }); 9 + // export default function NotificationsPage() { 10 + // const agent = useAuthedAgent(); 11 + // const notifications = useInfiniteQuery({ 12 + // queryKey: ["notifications"], 13 + // queryFn: async ({ pageParam }) => { 14 + // const notifs = await agent.listNotifications({ 15 + // cursor: pageParam as string | undefined, 16 + // }); 17 + // return notifs.data; 18 + // }, 19 + // getNextPageParam: (lastPage) => lastPage.cursor, 20 + // }); 21 21 22 - switch (notifications.status) { 23 - case "loading": 24 - return ( 25 - <View className="flex-1 items-center justify-center"> 26 - <Stack.Screen options={{ headerShown: true }} /> 27 - <ActivityIndicator /> 28 - </View> 29 - ); 22 + // switch (notifications.status) { 23 + // case "loading": 24 + // return ( 25 + // <View className="flex-1 items-center justify-center"> 26 + // <Stack.Screen options={{ headerShown: true }} /> 27 + // <ActivityIndicator /> 28 + // </View> 29 + // ); 30 30 31 - case "error": 32 - return ( 33 - <View className="flex-1 items-center justify-center p-4"> 34 - <Stack.Screen options={{ headerShown: true }} /> 35 - <Text className="text-center text-xl"> 36 - {(notifications.error as Error).message || "An error occurred"} 37 - </Text> 38 - <Button 39 - variant="outline" 40 - onPress={() => void notifications.refetch()} 41 - > 42 - Retry 43 - </Button> 44 - </View> 45 - ); 31 + // case "error": 32 + // return ( 33 + // <View className="flex-1 items-center justify-center p-4"> 34 + // <Stack.Screen options={{ headerShown: true }} /> 35 + // <Text className="text-center text-xl"> 36 + // {(notifications.error as Error).message || "An error occurred"} 37 + // </Text> 38 + // <Button 39 + // variant="outline" 40 + // onPress={() => void notifications.refetch()} 41 + // > 42 + // Retry 43 + // </Button> 44 + // </View> 45 + // ); 46 46 47 - case "success": 48 - return ( 49 - <> 50 - <Stack.Screen options={{ headerShown: true }} /> 51 - <FlashList 52 - data={notifications.data.pages.flatMap( 53 - (page) => page.notifications, 54 - )} 55 - renderItem={({ item }) => ( 56 - <View className="w-full border-b p-4"> 57 - <Text>{JSON.stringify(item, null, 2)}</Text> 58 - </View> 59 - )} 60 - onEndReachedThreshold={0.5} 61 - onEndReached={() => void notifications.fetchNextPage()} 62 - onRefresh={() => { 63 - if (!notifications.isRefetching) void notifications.refetch(); 64 - }} 65 - refreshing={notifications.isRefetching} 66 - ListFooterComponent={ 67 - notifications.isFetching ? ( 68 - <View className="w-full items-center py-4"> 69 - <ActivityIndicator /> 70 - </View> 71 - ) : null 72 - } 73 - /> 74 - </> 75 - ); 76 - } 47 + // case "success": 48 + // return ( 49 + // <> 50 + // <Stack.Screen options={{ headerShown: true }} /> 51 + // <FlashList 52 + // data={notifications.data.pages.flatMap( 53 + // (page) => page.notifications, 54 + // )} 55 + // renderItem={({ item }) => ( 56 + // <View className="w-full border-b p-4"> 57 + // <Text>{JSON.stringify(item, null, 2)}</Text> 58 + // </View> 59 + // )} 60 + // onEndReachedThreshold={0.5} 61 + // onEndReached={() => void notifications.fetchNextPage()} 62 + // onRefresh={() => { 63 + // if (!notifications.isRefetching) void notifications.refetch(); 64 + // }} 65 + // refreshing={notifications.isRefetching} 66 + // ListFooterComponent={ 67 + // notifications.isFetching ? ( 68 + // <View className="w-full items-center py-4"> 69 + // <ActivityIndicator /> 70 + // </View> 71 + // ) : null 72 + // } 73 + // /> 74 + // </> 75 + // ); 76 + // } 77 + // } 78 + 79 + import { Text, View } from "react-native"; 80 + 81 + export default function NotificationsPage() { 82 + return ( 83 + <View className="flex-1 justify-center"> 84 + <Text className="text-center text-xl">Coming soon</Text> 85 + </View> 86 + ); 77 87 }