diff --git a/android/app/build.gradle b/android/app/build.gradle index 81a94d3..01fd228 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -118,8 +118,9 @@ android { } } packagingOptions { + // NOTE: 16KB 페이지 크기 지원을 위해 레거시 패키징 사용을 비활성 jniLibs { - useLegacyPackaging (findProperty('expo.useLegacyPackaging')?.toBoolean() ?: false) + useLegacyPackaging (false) } } androidResources { diff --git a/android/gradle.properties b/android/gradle.properties index 4c80432..d26187b 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -54,7 +54,7 @@ EX_DEV_CLIENT_NETWORK_INSPECTOR=true # Use legacy packaging to compress native libraries in the resulting APK. expo.useLegacyPackaging=false -ndkVersion=26.1.10909125 - +# ndkVersion=26.1.10909125 +ndkVersion=29.0.14206865 # Whether the app is configured to use edge-to-edge via the app config or `react-native-edge-to-edge` plugin expo.edgeToEdgeEnabled=true \ No newline at end of file diff --git a/eas.json b/eas.json index 28eca32..4c58769 100644 --- a/eas.json +++ b/eas.json @@ -28,7 +28,11 @@ "production": { "autoIncrement": true, "android": { - "buildType": "app-bundle" + //"buildType": "apk" + "buildType": "app-bundle", + // NOTE: 16KB를 지원하기 위한 ndk 설정 + "ndk": "29.0.14206865", + "image": "latest" }, "ios": { "autoIncrement": "buildNumber", diff --git a/src/entities/recipe/ui/DetailDeleteComponent.tsx b/src/entities/recipe/ui/DetailDeleteComponent.tsx index 632d259..46687ef 100644 --- a/src/entities/recipe/ui/DetailDeleteComponent.tsx +++ b/src/entities/recipe/ui/DetailDeleteComponent.tsx @@ -1,6 +1,6 @@ import { Pressable, Alert } from 'react-native'; import TrashIcon from '@/assets/img/recipe/trash-slide.svg'; -import { useRecipeDelete } from '@entities/recipe'; +import { useRecipeDelete } from '@entities/recipe/api/useRecipeDelete'; const DetailDeleteComponent = ({ targetId }: { targetId: string }) => { const { mutate: deleteRecipe } = useRecipeDelete(); diff --git a/src/features/chat/ui/ChatInput.tsx b/src/features/chat/ui/ChatInput.tsx index 4bad1b9..992c286 100644 --- a/src/features/chat/ui/ChatInput.tsx +++ b/src/features/chat/ui/ChatInput.tsx @@ -23,7 +23,7 @@ const ChatInput = forwardRef( {userProfile ? ( ) : ( diff --git a/src/features/chat/ui/CommentItem.tsx b/src/features/chat/ui/CommentItem.tsx index afb7655..6831b3a 100644 --- a/src/features/chat/ui/CommentItem.tsx +++ b/src/features/chat/ui/CommentItem.tsx @@ -20,7 +20,7 @@ const CommentItem = ({ comment, onReplyPress, depth = 1 }: Props) => { {comment.profileImage ? ( ) : ( diff --git a/src/features/feed/ui/FeedCard.tsx b/src/features/feed/ui/FeedCard.tsx index e89ce45..48f2df0 100644 --- a/src/features/feed/ui/FeedCard.tsx +++ b/src/features/feed/ui/FeedCard.tsx @@ -35,7 +35,7 @@ const FeedCard = ({ feed, navigation }: Props) => { ) : ( diff --git a/src/features/user/model/useMyPageControllerQueries.ts b/src/features/user/model/useMyPageControllerQueries.ts index 40298f0..5439215 100644 --- a/src/features/user/model/useMyPageControllerQueries.ts +++ b/src/features/user/model/useMyPageControllerQueries.ts @@ -8,7 +8,7 @@ import { myPageApi } from '../api/myPageApi'; export const useFeedQuery = (userId: string) => { const { user: myUser } = useUserStore(); const queryClient = useQueryClient(); - const { data, isLoading, isError, refetch } = useQuery({ + const { data, isError, refetch } = useQuery({ queryKey: queryKeys.feed.list(userId), queryFn: () => { return myPageApi.getAllFeeds(userId); @@ -64,7 +64,6 @@ export const useFeedQuery = (userId: string) => { return { profile, feeds, - isLoading, isError, ensure, refetch, diff --git a/src/features/user/ui/EmptyStateUsingVideo.tsx b/src/features/user/ui/EmptyStateUsingVideo.tsx index 37e991e..eb9e396 100644 --- a/src/features/user/ui/EmptyStateUsingVideo.tsx +++ b/src/features/user/ui/EmptyStateUsingVideo.tsx @@ -23,6 +23,7 @@ const EmptyStateUsingVideo = ({ }: Props) => { const player = useVideoPlayer(video, player => { player.loop = true; + player.muted = true; player.play(); }); diff --git a/src/features/user/ui/FollowItem.tsx b/src/features/user/ui/FollowItem.tsx index 6ad7147..e4b3d89 100644 --- a/src/features/user/ui/FollowItem.tsx +++ b/src/features/user/ui/FollowItem.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useEffect, useState } from 'react'; import { View, Text, Pressable, TouchableOpacity } from 'react-native'; import { FollowingAndFollowerList } from '@entities/user'; @@ -9,11 +9,18 @@ import { UserProfileImage } from '@shared/ui'; interface Props { user: FollowingAndFollowerList; navigation: RootNavigationProp<'FollowDetail'>; + followingList: FollowingAndFollowerList[] | undefined; } -const FollowItem = ({ user, navigation }: Props) => { - // NOTE: 팔로우 기능 해야딤 - const [isFollowing, setIsFollowing] = useState(true); +const FollowItem = ({ user, navigation, followingList }: Props) => { + const [isFollowing, setIsFollowing] = useState(false); + useEffect(() => { + if (!followingList) return; + + const found = followingList.some(item => item.userId === user.userId); + console.log(found); + setIsFollowing(found); + }, [followingList, user]); // 팔로우/언팔로우 mutation 훅 const followMutation = useFollowUserQuery(); diff --git a/src/features/user/ui/FollowList.tsx b/src/features/user/ui/FollowList.tsx index 68e65f2..f701865 100644 --- a/src/features/user/ui/FollowList.tsx +++ b/src/features/user/ui/FollowList.tsx @@ -8,12 +8,17 @@ import EmptyFollowList from './EmptyFollowList'; import FollowItem from './FollowItem'; interface Props { - users: FollowingAndFollowerList[] | undefined; + followerList: FollowingAndFollowerList[] | undefined; + followingList: FollowingAndFollowerList[] | undefined; navigation: RootNavigationProp<'FollowDetail'>; + tab: string; } -const FollowList = ({ users, navigation }: Props) => { +const FollowList = ({ followerList, followingList, navigation, tab }: Props) => { const { height } = Dimensions.get('window'); + console.log(tab); + const users = tab === 'follower' ? followerList : followingList; + return ( { /> } - renderItem={({ item }) => } + renderItem={({ item }) => ( + + )} /> ); diff --git a/src/features/user/ui/header/AnotherUserHeaderSection.tsx b/src/features/user/ui/header/AnotherUserHeaderSection.tsx index 5769bf3..c5c2df0 100644 --- a/src/features/user/ui/header/AnotherUserHeaderSection.tsx +++ b/src/features/user/ui/header/AnotherUserHeaderSection.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React from 'react'; import { View, Text, TouchableOpacity, Pressable } from 'react-native'; import { UserFeeds } from '@entities/user'; @@ -10,11 +10,17 @@ type Props = { navigation: RootNavigationProp<'AnotherUserPage'>; profile: UserFeeds['profileBlockDto']; feedCount: number | undefined; + isFollowing: boolean; + setIsFollowing: React.Dispatch>; }; -const AnotherUserHeaderSection = ({ profile, navigation, feedCount }: Props) => { - const [isFollowing, setIsFollowing] = useState(true); - +const AnotherUserHeaderSection = ({ + profile, + navigation, + feedCount, + isFollowing, + setIsFollowing, +}: Props) => { // 팔로우/언팔로우 mutation 훅 const followMutation = useFollowUserQuery(); @@ -32,6 +38,7 @@ const AnotherUserHeaderSection = ({ profile, navigation, feedCount }: Props) => }, ); }; + return ( { const { userId } = route.params; + const { user: myUser } = useUserStore(); + + const { profile, feeds } = useFeedQuery(userId!); + + const { data: FollowingListData, isLoading: isLoadingFollowingList } = useFollowingListQuery( + myUser?.id ?? '0', + ); + + console.log(FollowingListData); + + const [isFollowing, setIsFollowing] = useState(false); + + // NOTE: 팔로잉 여부 계산 + useEffect(() => { + if (!FollowingListData) return; + + const found = FollowingListData.some(item => item.userId === userId); + console.log('파운드'); + console.log(found); + setIsFollowing(found); + }, [FollowingListData, userId]); - const { profile, feeds, isLoading: isLoadingRecipe } = useFeedQuery(userId!); if (!userId) return null; - else if (isLoadingRecipe || !profile) { + else if (!profile || isLoadingFollowingList) { return ( @@ -25,6 +51,8 @@ const AnotherUserPage = ({ navigation, route }: AnotherUserPageProps) => { profile={profile} navigation={navigation} feedCount={feeds?.content.length} + isFollowing={isFollowing} + setIsFollowing={setIsFollowing} /> {/* 피드/북마크 */} diff --git a/src/pages/user/ui/FollowDetail.tsx b/src/pages/user/ui/FollowDetail.tsx index 8111104..829b7f4 100644 --- a/src/pages/user/ui/FollowDetail.tsx +++ b/src/pages/user/ui/FollowDetail.tsx @@ -65,11 +65,14 @@ const FollowDetail = ({ navigation, route }: FollowDetailProps) => { - {tab === 'follower' ? ( - - ) : tab === 'following' ? ( - - ) : null} + {tab && ( + + )} ); diff --git a/src/pages/user/ui/Mypage.tsx b/src/pages/user/ui/Mypage.tsx index 9835fb8..5f1cb32 100644 --- a/src/pages/user/ui/Mypage.tsx +++ b/src/pages/user/ui/Mypage.tsx @@ -19,12 +19,7 @@ const Mypage: React.FC = ({ navigation }) => { const { bottomSheetVisible, bottomSheetClose } = useSettingBottomSheetStore(); const { user } = useUserStore(); - const { - profile, - feeds, - isLoading: isLoadingFeed, - ensure: feedEnsure, - } = useFeedQuery(user?.id ?? '0'); + const { profile, feeds, ensure: feedEnsure } = useFeedQuery(user?.id ?? '0'); const { bookmarks, isStale: isStaleBookmark, @@ -38,7 +33,7 @@ const Mypage: React.FC = ({ navigation }) => { }, [bookmarkEnsure, feedEnsure]), ); - if (isLoadingFeed || isStaleBookmark || !profile) { + if (isStaleBookmark || !profile) { return ( diff --git a/src/shared/api/useUserQuery.ts b/src/shared/api/useUserQuery.ts index 4ae9b1c..45696f4 100644 --- a/src/shared/api/useUserQuery.ts +++ b/src/shared/api/useUserQuery.ts @@ -28,6 +28,7 @@ export const useUserQuery = () => { useEffect(() => { if (query.isSuccess && query.data.result) { + console.log(query.data.result); setUser(query.data.result); } }, [query.isSuccess, query.data, setUser]); diff --git a/src/shared/ui/UserProfileImage.tsx b/src/shared/ui/UserProfileImage.tsx index 3f01f95..8a2f974 100644 --- a/src/shared/ui/UserProfileImage.tsx +++ b/src/shared/ui/UserProfileImage.tsx @@ -11,7 +11,7 @@ const UserProfileImage: React.FC = ({ uri, size = 110 }) => { return uri ? ( ) : (