diff --git a/SodaLive/Resources/Assets.xcassets/img_rank_1.imageset/Contents.json b/SodaLive/Resources/Assets.xcassets/img_rank_1.imageset/Contents.json new file mode 100644 index 0000000..a2e6fac --- /dev/null +++ b/SodaLive/Resources/Assets.xcassets/img_rank_1.imageset/Contents.json @@ -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 + } +} diff --git a/SodaLive/Resources/Assets.xcassets/img_rank_1.imageset/img_rank_1.png b/SodaLive/Resources/Assets.xcassets/img_rank_1.imageset/img_rank_1.png new file mode 100644 index 0000000..88abc56 Binary files /dev/null and b/SodaLive/Resources/Assets.xcassets/img_rank_1.imageset/img_rank_1.png differ diff --git a/SodaLive/Resources/Assets.xcassets/img_rank_2.imageset/Contents.json b/SodaLive/Resources/Assets.xcassets/img_rank_2.imageset/Contents.json new file mode 100644 index 0000000..ad7b6b5 --- /dev/null +++ b/SodaLive/Resources/Assets.xcassets/img_rank_2.imageset/Contents.json @@ -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 + } +} diff --git a/SodaLive/Resources/Assets.xcassets/img_rank_2.imageset/img_rank_2.png b/SodaLive/Resources/Assets.xcassets/img_rank_2.imageset/img_rank_2.png new file mode 100644 index 0000000..ca3a7ce Binary files /dev/null and b/SodaLive/Resources/Assets.xcassets/img_rank_2.imageset/img_rank_2.png differ diff --git a/SodaLive/Resources/Assets.xcassets/img_rank_3.imageset/Contents.json b/SodaLive/Resources/Assets.xcassets/img_rank_3.imageset/Contents.json new file mode 100644 index 0000000..1d6b7e6 --- /dev/null +++ b/SodaLive/Resources/Assets.xcassets/img_rank_3.imageset/Contents.json @@ -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 + } +} diff --git a/SodaLive/Resources/Assets.xcassets/img_rank_3.imageset/img_rank_3.png b/SodaLive/Resources/Assets.xcassets/img_rank_3.imageset/img_rank_3.png new file mode 100644 index 0000000..fc49d26 Binary files /dev/null and b/SodaLive/Resources/Assets.xcassets/img_rank_3.imageset/img_rank_3.png differ diff --git a/SodaLive/Resources/Assets.xcassets/rank_1.imageset/Contents.json b/SodaLive/Resources/Assets.xcassets/rank_1.imageset/Contents.json deleted file mode 100644 index 244013a..0000000 --- a/SodaLive/Resources/Assets.xcassets/rank_1.imageset/Contents.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "images" : [ - { - "filename" : "rank_1.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/SodaLive/Resources/Assets.xcassets/rank_1.imageset/rank_1.pdf b/SodaLive/Resources/Assets.xcassets/rank_1.imageset/rank_1.pdf deleted file mode 100644 index cd269fb..0000000 Binary files a/SodaLive/Resources/Assets.xcassets/rank_1.imageset/rank_1.pdf and /dev/null differ diff --git a/SodaLive/Resources/Assets.xcassets/rank_2.imageset/Contents.json b/SodaLive/Resources/Assets.xcassets/rank_2.imageset/Contents.json deleted file mode 100644 index 4f22f03..0000000 --- a/SodaLive/Resources/Assets.xcassets/rank_2.imageset/Contents.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "images" : [ - { - "filename" : "rank_2.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/SodaLive/Resources/Assets.xcassets/rank_2.imageset/rank_2.pdf b/SodaLive/Resources/Assets.xcassets/rank_2.imageset/rank_2.pdf deleted file mode 100644 index 2306469..0000000 Binary files a/SodaLive/Resources/Assets.xcassets/rank_2.imageset/rank_2.pdf and /dev/null differ diff --git a/SodaLive/Resources/Assets.xcassets/rank_3.imageset/Contents.json b/SodaLive/Resources/Assets.xcassets/rank_3.imageset/Contents.json deleted file mode 100644 index 1cc0a68..0000000 --- a/SodaLive/Resources/Assets.xcassets/rank_3.imageset/Contents.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "images" : [ - { - "filename" : "rank_3.pdf", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/SodaLive/Resources/Assets.xcassets/rank_3.imageset/rank_3.pdf b/SodaLive/Resources/Assets.xcassets/rank_3.imageset/rank_3.pdf deleted file mode 100644 index 496a226..0000000 Binary files a/SodaLive/Resources/Assets.xcassets/rank_3.imageset/rank_3.pdf and /dev/null differ diff --git a/SodaLive/Sources/Home/HomeCreatorRankingItemView.swift b/SodaLive/Sources/Home/HomeCreatorRankingItemView.swift index bba0e5d..ac8ec40 100644 --- a/SodaLive/Sources/Home/HomeCreatorRankingItemView.swift +++ b/SodaLive/Sources/Home/HomeCreatorRankingItemView.swift @@ -15,60 +15,60 @@ struct HomeCreatorRankingItemView: View { 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) var body: some View { - ZStack(alignment: .topLeading) { - VStack(spacing: 0) { + VStack(spacing: 0) { + ZStack(alignment: .center) { DownsampledKFImage( url: URL(string: item.profileImageUrl), size: CGSize(width: 84, height: 84) ) .clipShape(Circle()) - - Text(item.nickname) - .font(.custom(Font.preRegular.rawValue, size: 16)) - .foregroundColor(.white) - .padding(.top, 20) - 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) - } + if rank <= 3 { + Image(crowns[rank - 1]) + .resizable() + .frame(width: 108, height: 105) } } - .padding(16) - .frame(width: 144, height: 204) - .background(Color(hex: "263238")) - .cornerRadius(16) - .padding(.top, 20) + .frame(width: 108, height: 105) - if rank <= 3 { - Image(crowns[rank - 1]) - .resizable() - .frame(width: 40, height: 40) - .padding(.leading, 10) + Text(item.nickname) + .font(.custom(Font.preRegular.rawValue, size: 16)) + .foregroundColor(.white) + .padding(.top, 20) + + 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) } }