feat(chat): 캐릭터 상세 이동 로직 ChatTabView로 이관 및 로그인/본인인증 처리 추가
This commit is contained in:
@@ -12,6 +12,8 @@ struct CharacterView: View {
|
||||
|
||||
private let horizontalPadding: CGFloat = 16
|
||||
|
||||
let onSelectCharacter: (Int) -> Void
|
||||
|
||||
var body: some View {
|
||||
BaseView(isLoading: $viewModel.isLoading) {
|
||||
ScrollView(.vertical, showsIndicators: false) {
|
||||
@@ -19,7 +21,7 @@ struct CharacterView: View {
|
||||
// 배너
|
||||
if !viewModel.banners.isEmpty {
|
||||
AutoSlideCharacterBannerView(items: viewModel.banners) { banner in
|
||||
AppState.shared.setAppStep(step: .characterDetail(characterId: banner.characterId))
|
||||
onSelectCharacter(banner.characterId)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +31,7 @@ struct CharacterView: View {
|
||||
titleCount: viewModel.recentCharacters.count,
|
||||
items: viewModel.recentCharacters
|
||||
) { ch in
|
||||
AppState.shared.setAppStep(step: .characterDetail(characterId: ch.characterId))
|
||||
onSelectCharacter(ch.characterId)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +41,7 @@ struct CharacterView: View {
|
||||
title: "신규 캐릭터",
|
||||
items: viewModel.newCharacters
|
||||
) { ch in
|
||||
AppState.shared.setAppStep(step: .characterDetail(characterId: ch.characterId))
|
||||
onSelectCharacter(ch.characterId)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +54,7 @@ struct CharacterView: View {
|
||||
title: section.title,
|
||||
items: section.characters
|
||||
) { ch in
|
||||
AppState.shared.setAppStep(step: .characterDetail(characterId: ch.characterId))
|
||||
onSelectCharacter(ch.characterId)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -88,5 +90,5 @@ struct CharacterView: View {
|
||||
}
|
||||
|
||||
#Preview {
|
||||
CharacterView()
|
||||
CharacterView(onSelectCharacter: { _ in })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user