From 75a4fb9fb2191d1c9f8e93235cebb85cd72868e2 Mon Sep 17 00:00:00 2001 From: Simon Laux Date: Mon, 27 Jan 2025 00:12:01 +0100 Subject: [PATCH 01/29] fix lint --- src/app/(auth)/(tabs)/camera.tsx | 2 +- src/app/(auth)/(tabs)/index.tsx | 17 ++++-- src/app/(auth)/profile/likes/index.tsx | 2 +- src/app/(auth)/settings/profile.tsx | 73 +++++++++++++++----------- src/app/(auth)/settings/updateBio.tsx | 4 +- src/components/common/EmptyFeed.tsx | 22 ++++---- src/components/common/LikeButton.tsx | 4 +- src/components/icons/GhostIcon.tsx | 11 ++-- src/components/post/FeedPost.tsx | 47 +++++++++++------ src/hooks/mutations/useLikeMutation.ts | 4 +- 10 files changed, 108 insertions(+), 78 deletions(-) diff --git a/src/app/(auth)/(tabs)/camera.tsx b/src/app/(auth)/(tabs)/camera.tsx index 2eb25af6..a0efbf73 100644 --- a/src/app/(auth)/(tabs)/camera.tsx +++ b/src/app/(auth)/(tabs)/camera.tsx @@ -700,7 +700,7 @@ export default function Camera() { defaultValue={curAltText} onChangeText={setCurAltText} placeholder="Add optional alt text to describe the media for visually impaired" - autoCapitalize='sentences' + autoCapitalize="sentences" numberOfLines={3} /> diff --git a/src/app/(auth)/(tabs)/index.tsx b/src/app/(auth)/(tabs)/index.tsx index 9d57d4c2..6a002428 100644 --- a/src/app/(auth)/(tabs)/index.tsx +++ b/src/app/(auth)/(tabs)/index.tsx @@ -1,5 +1,11 @@ import { useCallback, useEffect, useState, useRef, useMemo } from 'react' -import { FlatList, StyleSheet, ActivityIndicator, Platform, ListRenderItemInfo } from 'react-native' +import { + FlatList, + StyleSheet, + ActivityIndicator, + Platform, + type ListRenderItemInfo, +} from 'react-native' import { Text, View, XStack, Spinner, YStack } from 'tamagui' import FeedPost from 'src/components/post/FeedPost' import { StatusBar } from 'expo-status-bar' @@ -34,7 +40,7 @@ import { useShareIntentContext } from 'expo-share-intent' import { useVideo } from 'src/hooks/useVideoProvider' import { useFocusEffect } from '@react-navigation/native' import { useUserCache } from 'src/state/AuthProvider' -import { Status } from 'src/lib/api-types' +import type { Status } from 'src/lib/api-types' export function ErrorBoundary(props: ErrorBoundaryProps) { return ( @@ -280,7 +286,8 @@ export default function HomeScreen() { } const renderFeed = (data: Array) => { - return (isFetchingNextPage ? : null)} /> + ) } return ( @@ -336,7 +344,6 @@ export default function HomeScreen() { {renderFeed(data?.pages.flatMap((page) => page.data))} - ) } @@ -366,5 +373,5 @@ const styles = StyleSheet.create({ textAlign: 'center', color: 'white', fontWeight: '800', - } + }, }) diff --git a/src/app/(auth)/profile/likes/index.tsx b/src/app/(auth)/profile/likes/index.tsx index b48b1e5f..4cbb6017 100644 --- a/src/app/(auth)/profile/likes/index.tsx +++ b/src/app/(auth)/profile/likes/index.tsx @@ -14,7 +14,7 @@ export default function LikesScreen() { useLayoutEffect(() => { navigation.setOptions({ title: 'My Likes', headerBackTitle: 'Back' }) }, [navigation]) - + const user = useUserCache() const renderItem = useCallback( ({ item }) => ( diff --git a/src/app/(auth)/settings/profile.tsx b/src/app/(auth)/settings/profile.tsx index 4d9078d1..de4155f3 100644 --- a/src/app/(auth)/settings/profile.tsx +++ b/src/app/(auth)/settings/profile.tsx @@ -1,4 +1,11 @@ -import { ActivityIndicator, Alert, type AlertButton, Platform, Pressable, StyleSheet } from 'react-native' +import { + ActivityIndicator, + Alert, + type AlertButton, + Platform, + Pressable, + StyleSheet, +} from 'react-native' import { ScrollView, Separator, @@ -105,21 +112,25 @@ export default function ProfilePage() { } const LinkField = ({ label, value, placeholder, path }: LinkFieldProps) => ( - - + + {label} - + {value || placeholder} @@ -136,22 +147,24 @@ export default function ProfilePage() { }} /> - {isFetching && } + {isFetching && ( + + )} - - + + - + @{user?.username}