feat: 메인 홈 - 인기 크리에이터, 최신 콘텐츠

- 터치시 로그인이 되어 있지 않으면 로그인 페이지로 이동
This commit is contained in:
Yu Sung
2025-07-14 19:59:43 +09:00
parent 87b43bd2c2
commit 3bc42b6e01
3 changed files with 28 additions and 7 deletions

View File

@@ -10,6 +10,8 @@ import Kingfisher
struct ContentItemView: View {
@AppStorage("token") private var token: String = UserDefaults.string(forKey: UserDefaultsKey.token)
let item: AudioContentMainItem
var body: some View {
@@ -51,7 +53,14 @@ struct ContentItemView: View {
.padding(.top, 4)
}
.frame(width: 168)
.onTapGesture { AppState.shared.setAppStep(step: .contentDetail(contentId: item.contentId)) }
.onTapGesture {
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
AppState.shared.setAppStep(step: .contentDetail(contentId: item.contentId))
} else {
AppState.shared
.setAppStep(step: .login)
}
}
}
}