홈 - 크리에이터 랭킹 뱃지 변경

This commit is contained in:
Yu Sung
2026-01-19 20:07:23 +09:00
parent 4d893a2081
commit 68dab028cc
13 changed files with 102 additions and 75 deletions

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "img_rank_1.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "img_rank_2.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "img_rank_3.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -1,12 +0,0 @@
{
"images" : [
{
"filename" : "rank_1.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -1,12 +0,0 @@
{
"images" : [
{
"filename" : "rank_2.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -1,12 +0,0 @@
{
"images" : [
{
"filename" : "rank_3.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -15,60 +15,60 @@ struct HomeCreatorRankingItemView: View {
let onClickFollow: (Int, Bool) -> Void let onClickFollow: (Int, Bool) -> Void
let crowns = ["rank_1", "rank_2", "rank_3"] let crowns = ["img_rank_1", "img_rank_2", "img_rank_3"]
@AppStorage("token") private var token: String = UserDefaults.string(forKey: UserDefaultsKey.token) @AppStorage("token") private var token: String = UserDefaults.string(forKey: UserDefaultsKey.token)
var body: some View { var body: some View {
ZStack(alignment: .topLeading) { VStack(spacing: 0) {
VStack(spacing: 0) { ZStack(alignment: .center) {
DownsampledKFImage( DownsampledKFImage(
url: URL(string: item.profileImageUrl), url: URL(string: item.profileImageUrl),
size: CGSize(width: 84, height: 84) size: CGSize(width: 84, height: 84)
) )
.clipShape(Circle()) .clipShape(Circle())
Text(item.nickname) if rank <= 3 {
.font(.custom(Font.preRegular.rawValue, size: 16)) Image(crowns[rank - 1])
.foregroundColor(.white) .resizable()
.padding(.top, 20) .frame(width: 108, height: 105)
Spacer()
if item.id != UserDefaults.int(forKey: .userId) {
Text(item.follow ? "팔로잉" : "팔로우")
.font(.custom(Font.preRegular.rawValue, size: 14))
.padding(.vertical, 4)
.frame(maxWidth: .infinity)
.background(
item.follow ? Color(hex: "455a64") : Color.white
)
.cornerRadius(999)
.foregroundColor(
item.follow ? .white : Color(hex: "263238")
)
.onTapGesture {
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
item.follow = !item.follow
}
onClickFollow(item.id, item.follow)
}
} }
} }
.padding(16) .frame(width: 108, height: 105)
.frame(width: 144, height: 204)
.background(Color(hex: "263238"))
.cornerRadius(16)
.padding(.top, 20)
if rank <= 3 { Text(item.nickname)
Image(crowns[rank - 1]) .font(.custom(Font.preRegular.rawValue, size: 16))
.resizable() .foregroundColor(.white)
.frame(width: 40, height: 40) .padding(.top, 20)
.padding(.leading, 10)
Spacer()
if item.id != UserDefaults.int(forKey: .userId) {
Text(item.follow ? "팔로잉" : "팔로우")
.font(.custom(Font.preRegular.rawValue, size: 14))
.padding(.vertical, 4)
.frame(maxWidth: .infinity)
.background(
item.follow ? Color(hex: "455a64") : Color.white
)
.cornerRadius(999)
.foregroundColor(
item.follow ? .white : Color(hex: "263238")
)
.onTapGesture {
if !token.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
item.follow = !item.follow
}
onClickFollow(item.id, item.follow)
}
} }
} }
.padding(16)
.frame(width: 144, height: 204)
.background(Color(hex: "263238"))
.cornerRadius(16)
.padding(.top, 20)
} }
} }