홈 - 크리에이터 랭킹 뱃지 변경
This commit is contained in:
21
SodaLive/Resources/Assets.xcassets/img_rank_1.imageset/Contents.json
vendored
Normal file
21
SodaLive/Resources/Assets.xcassets/img_rank_1.imageset/Contents.json
vendored
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
SodaLive/Resources/Assets.xcassets/img_rank_1.imageset/img_rank_1.png
vendored
Normal file
BIN
SodaLive/Resources/Assets.xcassets/img_rank_1.imageset/img_rank_1.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
21
SodaLive/Resources/Assets.xcassets/img_rank_2.imageset/Contents.json
vendored
Normal file
21
SodaLive/Resources/Assets.xcassets/img_rank_2.imageset/Contents.json
vendored
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
SodaLive/Resources/Assets.xcassets/img_rank_2.imageset/img_rank_2.png
vendored
Normal file
BIN
SodaLive/Resources/Assets.xcassets/img_rank_2.imageset/img_rank_2.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
21
SodaLive/Resources/Assets.xcassets/img_rank_3.imageset/Contents.json
vendored
Normal file
21
SodaLive/Resources/Assets.xcassets/img_rank_3.imageset/Contents.json
vendored
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
SodaLive/Resources/Assets.xcassets/img_rank_3.imageset/img_rank_3.png
vendored
Normal file
BIN
SodaLive/Resources/Assets.xcassets/img_rank_3.imageset/img_rank_3.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"images" : [
|
|
||||||
{
|
|
||||||
"filename" : "rank_1.pdf",
|
|
||||||
"idiom" : "universal"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"author" : "xcode",
|
|
||||||
"version" : 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"images" : [
|
|
||||||
{
|
|
||||||
"filename" : "rank_2.pdf",
|
|
||||||
"idiom" : "universal"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"author" : "xcode",
|
|
||||||
"version" : 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"images" : [
|
|
||||||
{
|
|
||||||
"filename" : "rank_3.pdf",
|
|
||||||
"idiom" : "universal"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"author" : "xcode",
|
|
||||||
"version" : 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
@@ -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)
|
|
||||||
.font(.custom(Font.preRegular.rawValue, size: 16))
|
|
||||||
.foregroundColor(.white)
|
|
||||||
.padding(.top, 20)
|
|
||||||
|
|
||||||
Spacer()
|
if rank <= 3 {
|
||||||
|
Image(crowns[rank - 1])
|
||||||
if item.id != UserDefaults.int(forKey: .userId) {
|
.resizable()
|
||||||
Text(item.follow ? "팔로잉" : "팔로우")
|
.frame(width: 108, height: 105)
|
||||||
.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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user