From 4b9cdeb82460ef43c533562f88a60aae85a49527 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Thu, 22 Jan 2026 19:04:48 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=B8=EA=B8=B0=20=ED=81=AC=EB=A6=AC?= =?UTF-8?q?=EC=97=90=EC=9D=B4=ED=84=B0=20=ED=8C=94=EB=A1=9C=EC=9A=B0=20?= =?UTF-8?q?=ED=95=B4=EC=A0=9C=20=EC=8B=9C=20=ED=99=95=EC=9D=B8=20=EB=8B=A4?= =?UTF-8?q?=EC=9D=B4=EC=96=BC=EB=A1=9C=EA=B7=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/HomeCreatorRankingItemView.swift | 21 ++++++--- SodaLive/Sources/Home/HomeTabView.swift | 46 +++++++++++++++++-- SodaLive/Sources/I18n/I18n.swift | 8 ++++ 3 files changed, 64 insertions(+), 11 deletions(-) diff --git a/SodaLive/Sources/Home/HomeCreatorRankingItemView.swift b/SodaLive/Sources/Home/HomeCreatorRankingItemView.swift index 81805c5..e138142 100644 --- a/SodaLive/Sources/Home/HomeCreatorRankingItemView.swift +++ b/SodaLive/Sources/Home/HomeCreatorRankingItemView.swift @@ -11,7 +11,7 @@ import Kingfisher struct HomeCreatorRankingItemView: View { let rank: Int - @State var item: GetExplorerSectionCreatorResponse + @Binding var item: GetExplorerSectionCreatorResponse let onClickFollow: (Int, Bool) -> Void @@ -57,11 +57,18 @@ struct HomeCreatorRankingItemView: View { item.follow ? .white : Color(hex: "263238") ) .onTapGesture { - if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty { - item.follow = !item.follow + let trimmedToken = token.trimmingCharacters(in: .whitespacesAndNewlines) + guard !trimmedToken.isEmpty else { + onClickFollow(item.id, item.follow) + return + } + + if item.follow { + onClickFollow(item.id, false) + } else { + item.follow = true + onClickFollow(item.id, true) } - - onClickFollow(item.id, item.follow) } } } @@ -76,12 +83,14 @@ struct HomeCreatorRankingItemView: View { #Preview { HomeCreatorRankingItemView( rank: 1, - item: GetExplorerSectionCreatorResponse( + item: .constant( + GetExplorerSectionCreatorResponse( id: 1, nickname: "유빈ASMR", tags: "", profileImageUrl: "https://cf.sodalive.net/profile/34806/34806-profile-49db6b45-bb1e-4dc7-917e-1a614a853f5f-4232-1752158072656", follow: true + ) ), onClickFollow: { _, _ in } ) diff --git a/SodaLive/Sources/Home/HomeTabView.swift b/SodaLive/Sources/Home/HomeTabView.swift index eb84705..5ea457a 100644 --- a/SodaLive/Sources/Home/HomeTabView.swift +++ b/SodaLive/Sources/Home/HomeTabView.swift @@ -22,6 +22,9 @@ struct HomeTabView: View { @State private var isShowAuthConfirmView: Bool = false @State private var pendingAction: (() -> Void)? = nil @State private var payload = Payload() + @State private var isShowUnfollowConfirmDialog = false + @State private var pendingUnfollowCreatorId: Int? = nil + @State private var pendingUnfollowCreatorName = "" var onTapPopularCharacterAllView: (() -> Void)? = nil @@ -124,17 +127,19 @@ struct HomeTabView: View { ScrollView(.horizontal, showsIndicators: false) { LazyHStack(spacing: 16) { - ForEach(0.. String { + pick( + ko: "\(nickname)님을 팔로우 해제 하시겠습니까?", + en: "Do you want to unfollow \(nickname)?", + ja: "\(nickname)さんのフォローを解除しますか?" + ) + } static var liveOnNow: String { pick(ko: "현재 라이브 중입니다.", en: "Live is currently ongoing.", ja: "現在ライブ配信中です。") } static var cannotReserveOwnLive: String { pick(ko: "내가 만든 라이브는 예약할 수 없습니다.", en: "reserve a live you created is required.", ja: "自分が作ったライブは予約できません。") }