마이 페이지

- 팔로잉 리스트 버튼 추가
This commit is contained in:
Yu Sung 2024-09-04 15:43:34 +09:00
parent f4d95e6755
commit 2bea2365a0
2 changed files with 41 additions and 19 deletions

View File

@ -14,36 +14,37 @@ struct FollowCreatorView: View {
var body: some View { var body: some View {
BaseView(isLoading: $viewModel.isLoading) { BaseView(isLoading: $viewModel.isLoading) {
VStack(spacing: 0) { VStack(spacing: 0) {
DetailNavigationBar(title: "팔로잉 채널리스트") DetailNavigationBar(title: "팔로잉 리스트")
HStack(spacing: 0) { HStack(spacing: 0) {
Text("") Text("")
.font(.custom(Font.medium.rawValue, size: 13.3)) .font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "eeeeee")) .foregroundColor(Color.grayee)
Text("\(viewModel.totalCount)") Text("\(viewModel.totalCount)")
.font(.custom(Font.medium.rawValue, size: 13.3)) .font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "dd4500")) .foregroundColor(Color.mainRed3)
Text("") Text("")
.font(.custom(Font.medium.rawValue, size: 13.3)) .font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color(hex: "eeeeee")) .foregroundColor(Color.grayee)
Spacer() Spacer()
} }
.padding(.horizontal, 13.3) .padding(.horizontal, 13.3)
.padding(.top, 6.7) .padding(.top, 6.7)
ScrollView(.vertical, showsIndicators: false) { if viewModel.totalCount > 0 {
VStack(spacing: 13.3) { ScrollView(.vertical, showsIndicators: false) {
ForEach(0..<viewModel.creatorList.count, id: \.self) { index in VStack(spacing: 13.3) {
let creator = viewModel.creatorList[index] ForEach(0..<viewModel.creatorList.count, id: \.self) { index in
let creator = viewModel.creatorList[index]
FollowCreatorItemView( FollowCreatorItemView(
creator: creator, creator: creator,
onClickFollow: { viewModel.creatorFollow(userId: $0) }, onClickFollow: { viewModel.creatorFollow(userId: $0) },
onClickUnFollow: { viewModel.creatorUnFollow(userId: $0) } onClickUnFollow: { viewModel.creatorUnFollow(userId: $0) }
) )
.padding(.horizontal, 20) .padding(.horizontal, 20)
.onTapGesture { .onTapGesture {
AppState.shared AppState.shared
@ -54,9 +55,15 @@ struct FollowCreatorView: View {
viewModel.getFollowedCreatorAllList() viewModel.getFollowedCreatorAllList()
} }
} }
}
} }
.padding(.top, 13.3)
} }
.padding(.top, 13.3) } else {
Text("팔로우 중인 채널이 없습니다.")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color.grayee)
.frame(maxHeight: .infinity)
} }
} }
.onAppear { .onAppear {
@ -69,7 +76,7 @@ struct FollowCreatorView: View {
.padding(.vertical, 13.3) .padding(.vertical, 13.3)
.frame(width: screenSize().width - 66.7, alignment: .center) .frame(width: screenSize().width - 66.7, alignment: .center)
.font(.custom(Font.medium.rawValue, size: 12)) .font(.custom(Font.medium.rawValue, size: 12))
.background(Color(hex: "3bb9f1")) .background(Color.button)
.foregroundColor(Color.white) .foregroundColor(Color.white)
.multilineTextAlignment(.leading) .multilineTextAlignment(.leading)
.cornerRadius(20) .cornerRadius(20)

View File

@ -72,8 +72,8 @@ struct MyPageView: View {
Text("내 채널 보기") Text("내 채널 보기")
.frame(width: screenSize().width - 26.7, height: 46.7) .frame(width: screenSize().width - 26.7, height: 46.7)
.font(.custom(Font.bold.rawValue, size: 15.3)) .font(.custom(Font.bold.rawValue, size: 15.3))
.foregroundColor(Color(hex: "eeeeee")) .foregroundColor(Color.grayee)
.background(Color(hex: "3bb9f1")) .background(Color.button)
.cornerRadius(6.7) .cornerRadius(6.7)
.padding(.top, 26.7) .padding(.top, 26.7)
.onTapGesture { .onTapGesture {
@ -81,6 +81,21 @@ struct MyPageView: View {
} }
} }
HStack(spacing: 8) {
Text("팔로잉 리스트")
.frame(maxWidth: .infinity)
.padding(.vertical, 13.3)
.font(.custom(Font.bold.rawValue, size: 15.3))
.foregroundColor(Color.grayee)
.background(Color.button)
.cornerRadius(6.7)
.onTapGesture {
AppState.shared.setAppStep(step: .followingList)
}
}
.padding(.top, 26.7)
.padding(.horizontal, 13.3)
if UserDefaults.int(forKey: .userId) != 17958 { if UserDefaults.int(forKey: .userId) != 17958 {
CanCardView(data: data) { CanCardView(data: data) {
viewModel.getMypage() viewModel.getMypage()
@ -149,7 +164,7 @@ struct MyPageView: View {
.padding(.vertical, 13.3) .padding(.vertical, 13.3)
.frame(width: geo.size.width - 66.7, alignment: .center) .frame(width: geo.size.width - 66.7, alignment: .center)
.font(.custom(Font.medium.rawValue, size: 12)) .font(.custom(Font.medium.rawValue, size: 12))
.background(Color(hex: "9970ff")) .background(Color.button)
.foregroundColor(Color.white) .foregroundColor(Color.white)
.multilineTextAlignment(.center) .multilineTextAlignment(.center)
.cornerRadius(20) .cornerRadius(20)