From d8d1115c82587500755b2cb6c0c9d07c1735e2cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cxixn2=E2=80=9D?= Date: Sun, 29 Dec 2024 20:00:50 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20::=20[#33]=20=EC=BD=94=EB=93=9C?= =?UTF-8?q?=20=EC=A4=84=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DetailFeature/Sources/DetailView.swift | 21 ++++++++----------- .../RankFeature/Sources/RankView.swift | 1 + 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Projects/App/Sources/Feature/DetailFeature/Sources/DetailView.swift b/Projects/App/Sources/Feature/DetailFeature/Sources/DetailView.swift index bff29d4..509edbc 100644 --- a/Projects/App/Sources/Feature/DetailFeature/Sources/DetailView.swift +++ b/Projects/App/Sources/Feature/DetailFeature/Sources/DetailView.swift @@ -3,9 +3,8 @@ import SwiftUI struct DetailView: View { @StateObject var viewModel: DetailViewModel @State private var topNavigationState: Bool = false - @State private var emojiName: [String] = ["heart", "congrats", "thumbsUp", "thinking", "poop", "china"] + @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 emojiStates: [Int] = [0, 2, 3, 400, 500, 600] @State private var test: [Bool] = [false, false, false, false, false, false] @State private var graySmileState: Bool = false @Environment(\.dismiss) private var dismiss @@ -96,7 +95,6 @@ struct DetailView: View { .padding(.top, 16) .padding(.leading, 16) - HStack(spacing: 8) { ForEach(tagList.indices, id: \.self) { tag in Text("@\(tagList[tag].name)") @@ -107,7 +105,6 @@ struct DetailView: View { .padding(.top, 6) .padding(.leading, 16) - let dateString = createTime.split(separator: "T").first if let dateString = dateString { let components = dateString.split(separator: "-") @@ -155,12 +152,14 @@ struct DetailView: View { postViewModel.postEmoji { success in print("\(emojiName[tag]) 성공") - if checkEmojiList[tag] == true { - emojiList[tag] -= 1 - checkEmojiList[tag].toggle() - } else { - emojiList[tag] = 1 - checkEmojiList[tag].toggle() + if success { + if checkEmojiList[tag] == true { + emojiList[tag] -= 1 + checkEmojiList[tag].toggle() + } else { + emojiList[tag] = 1 + checkEmojiList[tag].toggle() + } } } }) { @@ -177,11 +176,9 @@ struct DetailView: View { .padding(.leading, 20) .padding(.top, 10) } - } } - Spacer() } .padding(.top, 8) diff --git a/Projects/App/Sources/Feature/RankFeature/Sources/RankView.swift b/Projects/App/Sources/Feature/RankFeature/Sources/RankView.swift index f633594..2cb9c03 100644 --- a/Projects/App/Sources/Feature/RankFeature/Sources/RankView.swift +++ b/Projects/App/Sources/Feature/RankFeature/Sources/RankView.swift @@ -169,5 +169,6 @@ struct RankView: View { } } } + .navigationBarBackButtonHidden(true) } }