AI 채팅 원작 상세 - 번역 데이터가 있으면 번역 데이터를 표시하도록 수정
This commit is contained in:
@@ -24,13 +24,14 @@ struct OriginalWorkDetailHeaderView: View {
|
||||
.cornerRadius(16)
|
||||
}
|
||||
|
||||
Text(item.title)
|
||||
// 번역 데이터가 있으면 번역값을 우선 사용
|
||||
Text(item.translated?.title ?? item.title)
|
||||
.font(.custom(Font.preBold.rawValue, size: 26))
|
||||
.foregroundColor(.white)
|
||||
.padding(.top, 40)
|
||||
|
||||
HStack(spacing: 4) {
|
||||
Text(item.contentType)
|
||||
Text(item.translated?.contentType ?? item.contentType)
|
||||
.font(.custom(Font.preRegular.rawValue, size: 14))
|
||||
.foregroundColor(Color(hex: "B0BEC5"))
|
||||
.padding(.horizontal, 7)
|
||||
@@ -43,7 +44,7 @@ struct OriginalWorkDetailHeaderView: View {
|
||||
.foregroundColor(.white)
|
||||
}
|
||||
|
||||
Text(item.category)
|
||||
Text(item.translated?.category ?? item.category)
|
||||
.font(.custom(Font.preRegular.rawValue, size: 14))
|
||||
.foregroundColor(.button)
|
||||
.padding(.horizontal, 7)
|
||||
@@ -74,7 +75,7 @@ struct OriginalWorkDetailHeaderView: View {
|
||||
.padding(.top, 14)
|
||||
|
||||
Text(
|
||||
item.tags
|
||||
(item.translated?.tags ?? item.tags)
|
||||
.map { $0.hasPrefix("#") ? $0 : "#\($0)" }
|
||||
.joined(separator: " ")
|
||||
)
|
||||
@@ -101,7 +102,8 @@ struct OriginalWorkDetailHeaderView: View {
|
||||
studio: nil,
|
||||
originalLinks: [],
|
||||
tags: [],
|
||||
characters: []
|
||||
characters: [],
|
||||
translated: nil
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -19,4 +19,13 @@ struct OriginalWorkDetailResponse: Decodable {
|
||||
let originalLinks: [String]
|
||||
let tags: [String]
|
||||
let characters: [Character]
|
||||
let translated: TranslatedOriginalWork?
|
||||
}
|
||||
|
||||
struct TranslatedOriginalWork: Decodable {
|
||||
let title: String
|
||||
let contentType: String
|
||||
let category: String
|
||||
let description: String
|
||||
let tags: [String]
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ struct OriginalWorkInfoView: View {
|
||||
.font(.custom(Font.preBold.rawValue, size: 16))
|
||||
.foregroundColor(.white)
|
||||
|
||||
Text(response.description)
|
||||
Text(response.translated?.description ?? response.description)
|
||||
.font(.custom(Font.preRegular.rawValue, size: 14))
|
||||
.foregroundColor(Color(hex: "B0BEC5"))
|
||||
.lineLimit(isExpandDesc ? Int.max : 3)
|
||||
|
||||
Reference in New Issue
Block a user