Skip to content

Commit

Permalink
🎨 :: [#33] 코드 줄 정리
Browse files Browse the repository at this point in the history
  • Loading branch information
Xixn2 committed Dec 29, 2024
1 parent a1d10be commit d8d1115
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)")
Expand All @@ -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: "-")
Expand Down Expand Up @@ -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()
}
}
}
}) {
Expand All @@ -177,11 +176,9 @@ struct DetailView: View {
.padding(.leading, 20)
.padding(.top, 10)
}

}
}


Spacer()
}
.padding(.top, 8)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,5 +169,6 @@ struct RankView: View {
}
}
}
.navigationBarBackButtonHidden(true)
}
}

0 comments on commit d8d1115

Please sign in to comment.