feat(chat-character): 캐릭터 신규 이미지 표시 UI 추가

This commit is contained in:
Yu Sung
2025-11-14 00:47:20 +09:00
parent 7de2b1c4dd
commit 1f88bcbddc
4 changed files with 32 additions and 11 deletions

View File

@@ -21,19 +21,38 @@ struct CharacterItemView: View {
var body: some View {
VStack(alignment: .leading, spacing: 4) {
ZStack(alignment: .bottomLeading) {
ZStack(alignment: .leading) {
DownsampledKFImage(
url: URL(string: character.imageUrl),
size: CGSize(width: size, height: size)
)
.cornerRadius(12)
if isShowRank {
Text("\(rank)")
.font(.custom(Font.preBold.rawValue, size: 72))
.foregroundColor(.white)
.lineLimit(1)
.frame(height: capHeight)
VStack {
if character.isNew {
HStack {
Spacer()
Text("N")
.font(.custom(Font.preRegular.rawValue, size: 18))
.foregroundColor(.white)
.frame(width: 30, height: 30)
.background(Color.button)
.clipShape(Circle())
}
.padding(.top, 8)
.padding(.trailing, 8)
}
Spacer()
if isShowRank {
Text("\(rank)")
.font(.custom(Font.preBold.rawValue, size: 72))
.foregroundColor(.white)
.lineLimit(1)
.frame(height: capHeight)
}
}
}
@@ -56,7 +75,7 @@ struct CharacterItemView: View {
#Preview {
CharacterItemView(
character: Character(characterId: 1, name: "찰리", description: "새로운 친구", imageUrl: "https://picsum.photos/300"),
character: Character(characterId: 1, name: "찰리", description: "새로운 친구", imageUrl: "https://picsum.photos/300", isNew: true),
size: 168,
rank: 20,
isShowRank: true