feat: 메인 홈 - 인기 크리에이터, 최신 콘텐츠
- 터치시 로그인이 되어 있지 않으면 로그인 페이지로 이동
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user