diff --git a/Projects/App/Sources/Feature/DetailFeature/Sources/DetailView.swift b/Projects/App/Sources/Feature/DetailFeature/Sources/DetailView.swift index 509edbc..eeea41f 100644 --- a/Projects/App/Sources/Feature/DetailFeature/Sources/DetailView.swift +++ b/Projects/App/Sources/Feature/DetailFeature/Sources/DetailView.swift @@ -5,7 +5,6 @@ struct DetailView: View { @State private var topNavigationState: Bool = false @State private var emojiName: [String] = ["heart", "congrats", "ThumbsUp", "thinking", "poop", "china"] @State private var emojiServerName: [String] = ["HEART", "CONGRATUATION", "THUMBSUP", "THINKING", "POOP", "CHINA"] - @State private var test: [Bool] = [false, false, false, false, false, false] @State private var graySmileState: Bool = false @Environment(\.dismiss) private var dismiss @StateObject var postViewModel: PostViewModel diff --git a/Projects/App/Sources/Feature/MyPageFeature/Sources/MyPageView.swift b/Projects/App/Sources/Feature/MyPageFeature/Sources/MyPageView.swift index 24a836a..5f691e4 100644 --- a/Projects/App/Sources/Feature/MyPageFeature/Sources/MyPageView.swift +++ b/Projects/App/Sources/Feature/MyPageFeature/Sources/MyPageView.swift @@ -120,17 +120,7 @@ struct MyPageView: View { ScrollView { LazyVGrid(columns: columns, spacing: 2) { - ForEach(postViewModel.myPostList.indices, id: \.self) { index in - let myPost = postViewModel.myPostList[index] - - let myPostEmojiArray = [ - myPost.emojiList.heartCount, - myPost.emojiList.congCount, - myPost.emojiList.thumbsCount, - myPost.emojiList.thinkCount, - myPost.emojiList.poopCount, - myPost.emojiList.chinaCount - ] + ForEach(postViewModel.myPostList, id: \.id) { myPost in NavigationLink(destination: DetailView( viewModel: DetailViewModel(), @@ -142,7 +132,14 @@ struct MyPageView: View { grade: myPost.author.grade, imageUrl: myPost.imageUrl, tagList: myPost.tagList.map { ($0.name, $0.id) }, - emojiList: myPostEmojiArray, + emojiList: [ + myPost.emojiList.heartCount, + myPost.emojiList.congCount, + myPost.emojiList.thumbsCount, + myPost.emojiList.thinkCount, + myPost.emojiList.poopCount, + myPost.emojiList.chinaCount + ], checkEmojiList: myPost.checkEmoji, createTime: myPost.createdTime )) { @@ -173,17 +170,7 @@ struct MyPageView: View { ScrollView { LazyVGrid(columns: columns1, spacing: 2) { - ForEach(postViewModel.myReactionPostList.indices, id: \.self) { index in - let rtPost = postViewModel.myReactionPostList[index] - - let emojiArray = [ - rtPost.emojiList.heartCount, - rtPost.emojiList.congCount, - rtPost.emojiList.thumbsCount, - rtPost.emojiList.thinkCount, - rtPost.emojiList.poopCount, - rtPost.emojiList.chinaCount - ] + ForEach(postViewModel.myReactionPostList, id: \.id) { rtPost in NavigationLink(destination: DetailView( viewModel: DetailViewModel(), @@ -195,7 +182,14 @@ struct MyPageView: View { grade: rtPost.author.grade, imageUrl: rtPost.imageUrl, tagList: rtPost.tagList.map { ($0.name, $0.id) }, - emojiList: emojiArray, + emojiList: [ + rtPost.emojiList.heartCount, + rtPost.emojiList.congCount, + rtPost.emojiList.thumbsCount, + rtPost.emojiList.thinkCount, + rtPost.emojiList.poopCount, + rtPost.emojiList.chinaCount + ], checkEmojiList: rtPost.checkEmoji, createTime: rtPost.createdTime )) {