parent
ca7a2d4c72
commit
b5b53f95c7
|
@ -36,12 +36,18 @@ struct AuditionApplicantItemView: View {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.onTapGesture {
|
||||||
|
AppState.shared.setAppStep(step: .creatorDetail(userId: item.memberId))
|
||||||
|
}
|
||||||
|
|
||||||
VStack(spacing: 8) {
|
VStack(spacing: 8) {
|
||||||
HStack(spacing: 0) {
|
HStack(spacing: 0) {
|
||||||
Text(item.nickname.count > 9 ? "\(item.nickname.prefix(9))..." : item.nickname)
|
Text(item.nickname.count > 9 ? "\(item.nickname.prefix(9))..." : item.nickname)
|
||||||
.font(.custom(Font.medium.rawValue, size: 12))
|
.font(.custom(Font.medium.rawValue, size: 12))
|
||||||
.foregroundColor(Color.white)
|
.foregroundColor(Color.white)
|
||||||
|
.onTapGesture {
|
||||||
|
AppState.shared.setAppStep(step: .creatorDetail(userId: item.memberId))
|
||||||
|
}
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ struct GetCreatorProfileResponse: Decodable {
|
||||||
let activitySummary: GetCreatorActivitySummary
|
let activitySummary: GetCreatorActivitySummary
|
||||||
let seriesList: [SeriesListItem]
|
let seriesList: [SeriesListItem]
|
||||||
let isBlock: Bool
|
let isBlock: Bool
|
||||||
|
let isCreatorRole: Bool
|
||||||
}
|
}
|
||||||
|
|
||||||
struct CreatorResponse: Decodable {
|
struct CreatorResponse: Decodable {
|
||||||
|
|
|
@ -11,6 +11,7 @@ import Kingfisher
|
||||||
struct UserProfileCreatorView: View {
|
struct UserProfileCreatorView: View {
|
||||||
|
|
||||||
let creator: CreatorResponse
|
let creator: CreatorResponse
|
||||||
|
let isCreator: Bool
|
||||||
|
|
||||||
let creatorFollow: () -> Void
|
let creatorFollow: () -> Void
|
||||||
let showCreatorFollowNotifyDialog: () -> Void
|
let showCreatorFollowNotifyDialog: () -> Void
|
||||||
|
@ -42,10 +43,12 @@ struct UserProfileCreatorView: View {
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
Image("btn_big_share")
|
if isCreator {
|
||||||
.resizable()
|
Image("btn_big_share")
|
||||||
.frame(width: 33.3, height: 33.3)
|
.resizable()
|
||||||
.onTapGesture { shareChannel() }
|
.frame(width: 33.3, height: 33.3)
|
||||||
|
.onTapGesture { shareChannel() }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if creator.creatorId == UserDefaults.int(forKey: .userId) {
|
if creator.creatorId == UserDefaults.int(forKey: .userId) {
|
||||||
|
@ -158,7 +161,8 @@ struct UserProfileCreatorView_Previews: PreviewProvider {
|
||||||
isNotify: false,
|
isNotify: false,
|
||||||
isNotification: false,
|
isNotification: false,
|
||||||
notificationRecipientCount: 2
|
notificationRecipientCount: 2
|
||||||
)
|
),
|
||||||
|
isCreator: false
|
||||||
) {
|
) {
|
||||||
} showCreatorFollowNotifyDialog: {
|
} showCreatorFollowNotifyDialog: {
|
||||||
} shareChannel: {
|
} shareChannel: {
|
||||||
|
|
|
@ -52,171 +52,174 @@ struct UserProfileView: View {
|
||||||
VStack(spacing: 0) {
|
VStack(spacing: 0) {
|
||||||
if let creatorProfile = viewModel.creatorProfile {
|
if let creatorProfile = viewModel.creatorProfile {
|
||||||
VStack(spacing: 0) {
|
VStack(spacing: 0) {
|
||||||
UserProfileCreatorView(
|
UserProfileCreatorView(creator: creatorProfile.creator, isCreator: creatorProfile.isCreatorRole) {
|
||||||
creator: creatorProfile.creator) {
|
viewModel.creatorFollow()
|
||||||
viewModel.creatorFollow()
|
} showCreatorFollowNotifyDialog: {
|
||||||
} showCreatorFollowNotifyDialog: {
|
isShowFollowNotifyDialog = true
|
||||||
isShowFollowNotifyDialog = true
|
} shareChannel: {
|
||||||
} shareChannel: {
|
viewModel.shareChannel(userId: userId)
|
||||||
viewModel.shareChannel(userId: userId)
|
}
|
||||||
}
|
|
||||||
|
|
||||||
UserProfileActivitySummaryView(item: creatorProfile.activitySummary)
|
if creatorProfile.isCreatorRole {
|
||||||
.padding(.top, 13.3)
|
UserProfileActivitySummaryView(item: creatorProfile.activitySummary)
|
||||||
.padding(.horizontal, 13.3)
|
.padding(.top, 13.3)
|
||||||
|
.padding(.horizontal, 13.3)
|
||||||
if viewModel.communityPostList.count > 0 {
|
|
||||||
ScrollView(.horizontal, showsIndicators: false) {
|
if viewModel.communityPostList.count > 0 {
|
||||||
LazyHStack(spacing: 13.3) {
|
ScrollView(.horizontal, showsIndicators: false) {
|
||||||
if UserDefaults.int(forKey: .userId) == creatorProfile.creator.creatorId {
|
LazyHStack(spacing: 13.3) {
|
||||||
CreatorCommunityWriteItemView()
|
if UserDefaults.int(forKey: .userId) == creatorProfile.creator.creatorId {
|
||||||
.onTapGesture {
|
CreatorCommunityWriteItemView()
|
||||||
AppState.shared.setAppStep(
|
.onTapGesture {
|
||||||
step: .creatorCommunityWrite(
|
AppState.shared.setAppStep(
|
||||||
onSuccess: creatorCommunityWriteSuccess
|
step: .creatorCommunityWrite(
|
||||||
|
onSuccess: creatorCommunityWriteSuccess
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ForEach(0..<viewModel.communityPostList.count, id: \.self) { index in
|
||||||
|
let item = viewModel.communityPostList[index]
|
||||||
|
CreatorCommunityItemView(item: item)
|
||||||
|
.frame(width: 320)
|
||||||
|
.onTapGesture {
|
||||||
|
AppState.shared
|
||||||
|
.setAppStep(
|
||||||
|
step: .creatorCommunityAll(creatorId: userId)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CreatorCommunityMoreItemView {
|
||||||
|
AppState.shared
|
||||||
|
.setAppStep(
|
||||||
|
step: .creatorCommunityAll(creatorId: userId)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ForEach(0..<viewModel.communityPostList.count, id: \.self) { index in
|
|
||||||
let item = viewModel.communityPostList[index]
|
|
||||||
CreatorCommunityItemView(item: item)
|
|
||||||
.frame(width: 320)
|
|
||||||
.onTapGesture {
|
|
||||||
AppState.shared
|
|
||||||
.setAppStep(
|
|
||||||
step: .creatorCommunityAll(creatorId: userId)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CreatorCommunityMoreItemView {
|
|
||||||
AppState.shared
|
|
||||||
.setAppStep(
|
|
||||||
step: .creatorCommunityAll(creatorId: userId)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
.padding(.horizontal, 13.3)
|
||||||
}
|
}
|
||||||
.padding(.horizontal, 13.3)
|
.frame(minHeight: 146)
|
||||||
}
|
|
||||||
.frame(minHeight: 146)
|
|
||||||
.padding(.top, 26.7)
|
|
||||||
} else {
|
|
||||||
if UserDefaults.int(forKey: .userId) == creatorProfile.creator.creatorId {
|
|
||||||
CreatorCommunityNoPostsItemView(
|
|
||||||
onSuccess: creatorCommunityWriteSuccess
|
|
||||||
)
|
|
||||||
.padding(.top, 26.7)
|
.padding(.top, 26.7)
|
||||||
.padding(.horizontal, 13.3)
|
} else {
|
||||||
}
|
if UserDefaults.int(forKey: .userId) == creatorProfile.creator.creatorId {
|
||||||
}
|
CreatorCommunityNoPostsItemView(
|
||||||
}
|
onSuccess: creatorCommunityWriteSuccess
|
||||||
|
)
|
||||||
if !creatorProfile.seriesList.isEmpty {
|
.padding(.top, 26.7)
|
||||||
UserProfileSeriesView(
|
.padding(.horizontal, 13.3)
|
||||||
creatorId: creatorProfile.creator.creatorId,
|
|
||||||
items: creatorProfile.seriesList
|
|
||||||
)
|
|
||||||
.padding(.top, 26.7)
|
|
||||||
.padding(.horizontal, 13.3)
|
|
||||||
}
|
|
||||||
|
|
||||||
if creatorProfile.contentList.count > 0 ||
|
|
||||||
userId == UserDefaults.int(forKey: .userId)
|
|
||||||
{
|
|
||||||
UserProfileContentView(
|
|
||||||
userId: userId,
|
|
||||||
items: creatorProfile.contentList
|
|
||||||
)
|
|
||||||
.padding(.top, 26.7)
|
|
||||||
.padding(.horizontal, 13.3)
|
|
||||||
}
|
|
||||||
|
|
||||||
if creatorProfile.creator.creatorId == UserDefaults.int(forKey: .userId) || creatorProfile.liveRoomList.count > 0 {
|
|
||||||
VStack(alignment: .leading, spacing: 26.7) {
|
|
||||||
Text("라이브")
|
|
||||||
.font(.custom(Font.bold.rawValue, size: 16.7))
|
|
||||||
.foregroundColor(Color.grayee)
|
|
||||||
|
|
||||||
if creatorProfile.creator.creatorId == UserDefaults.int(forKey: .userId) {
|
|
||||||
HStack(spacing: 8) {
|
|
||||||
Text("룰렛 설정")
|
|
||||||
.font(.custom(Font.bold.rawValue, size: 15))
|
|
||||||
.foregroundColor(Color.grayee)
|
|
||||||
.padding(.vertical, 17)
|
|
||||||
.frame(maxWidth: .infinity)
|
|
||||||
.background(Color.button)
|
|
||||||
.cornerRadius(5.3)
|
|
||||||
.onTapGesture { isShowRouletteSettings = true }
|
|
||||||
|
|
||||||
Text("메뉴 설정")
|
|
||||||
.font(.custom(Font.bold.rawValue, size: 15))
|
|
||||||
.foregroundColor(Color.grayee)
|
|
||||||
.padding(.vertical, 17)
|
|
||||||
.frame(maxWidth: .infinity)
|
|
||||||
.background(Color.button)
|
|
||||||
.cornerRadius(5.3)
|
|
||||||
.onTapGesture { isShowMenuSettings = true }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if creatorProfile.liveRoomList.count > 0 {
|
}
|
||||||
UserProfileLiveView(
|
|
||||||
userId: userId,
|
if creatorProfile.isCreatorRole {
|
||||||
liveRoomList: creatorProfile.liveRoomList,
|
if !creatorProfile.seriesList.isEmpty {
|
||||||
onClickParticipant: { liveRoom in
|
UserProfileSeriesView(
|
||||||
if creatorProfile.creator.creatorId == UserDefaults.int(forKey: .userId) {
|
creatorId: creatorProfile.creator.creatorId,
|
||||||
viewModel.errorMessage = "현재 라이브 중입니다."
|
items: creatorProfile.seriesList
|
||||||
viewModel.isShowPopup = true
|
)
|
||||||
} else {
|
.padding(.top, 26.7)
|
||||||
AppState.shared.isShowPlayer = false
|
.padding(.horizontal, 13.3)
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
|
}
|
||||||
viewModel.enterLiveRoom(roomId: liveRoom.roomId)
|
|
||||||
|
if creatorProfile.contentList.count > 0 ||
|
||||||
|
userId == UserDefaults.int(forKey: .userId)
|
||||||
|
{
|
||||||
|
UserProfileContentView(
|
||||||
|
userId: userId,
|
||||||
|
items: creatorProfile.contentList
|
||||||
|
)
|
||||||
|
.padding(.top, 26.7)
|
||||||
|
.padding(.horizontal, 13.3)
|
||||||
|
}
|
||||||
|
|
||||||
|
if creatorProfile.creator.creatorId == UserDefaults.int(forKey: .userId) || creatorProfile.liveRoomList.count > 0 {
|
||||||
|
VStack(alignment: .leading, spacing: 26.7) {
|
||||||
|
Text("라이브")
|
||||||
|
.font(.custom(Font.bold.rawValue, size: 16.7))
|
||||||
|
.foregroundColor(Color.grayee)
|
||||||
|
|
||||||
|
if creatorProfile.creator.creatorId == UserDefaults.int(forKey: .userId) {
|
||||||
|
HStack(spacing: 8) {
|
||||||
|
Text("룰렛 설정")
|
||||||
|
.font(.custom(Font.bold.rawValue, size: 15))
|
||||||
|
.foregroundColor(Color.grayee)
|
||||||
|
.padding(.vertical, 17)
|
||||||
|
.frame(maxWidth: .infinity)
|
||||||
|
.background(Color.button)
|
||||||
|
.cornerRadius(5.3)
|
||||||
|
.onTapGesture { isShowRouletteSettings = true }
|
||||||
|
|
||||||
|
Text("메뉴 설정")
|
||||||
|
.font(.custom(Font.bold.rawValue, size: 15))
|
||||||
|
.foregroundColor(Color.grayee)
|
||||||
|
.padding(.vertical, 17)
|
||||||
|
.frame(maxWidth: .infinity)
|
||||||
|
.background(Color.button)
|
||||||
|
.cornerRadius(5.3)
|
||||||
|
.onTapGesture { isShowMenuSettings = true }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if creatorProfile.liveRoomList.count > 0 {
|
||||||
|
UserProfileLiveView(
|
||||||
|
userId: userId,
|
||||||
|
liveRoomList: creatorProfile.liveRoomList,
|
||||||
|
onClickParticipant: { liveRoom in
|
||||||
|
if creatorProfile.creator.creatorId == UserDefaults.int(forKey: .userId) {
|
||||||
|
viewModel.errorMessage = "현재 라이브 중입니다."
|
||||||
|
viewModel.isShowPopup = true
|
||||||
|
} else {
|
||||||
|
AppState.shared.isShowPlayer = false
|
||||||
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
|
||||||
|
viewModel.enterLiveRoom(roomId: liveRoom.roomId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onClickReservation: { liveRoom in
|
||||||
|
if creatorProfile.creator.creatorId == UserDefaults.int(forKey: .userId) {
|
||||||
|
viewModel.errorMessage = "내가 만든 라이브는 예약할 수 없습니다."
|
||||||
|
viewModel.isShowPopup = true
|
||||||
|
} else {
|
||||||
|
viewModel.reservationLiveRoom(roomId: liveRoom.roomId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
)
|
||||||
onClickReservation: { liveRoom in
|
}
|
||||||
if creatorProfile.creator.creatorId == UserDefaults.int(forKey: .userId) {
|
|
||||||
viewModel.errorMessage = "내가 만든 라이브는 예약할 수 없습니다."
|
|
||||||
viewModel.isShowPopup = true
|
|
||||||
} else {
|
|
||||||
viewModel.reservationLiveRoom(roomId: liveRoom.roomId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
.padding(.top, 26.7)
|
||||||
.padding(.top, 26.7)
|
|
||||||
.padding(.horizontal, 13.3)
|
|
||||||
}
|
|
||||||
|
|
||||||
VStack(spacing: 26.7) {
|
|
||||||
let introduce = creatorProfile.creator.introduce
|
|
||||||
UserProfileIntroduceView(
|
|
||||||
introduce: introduce.trimmingCharacters(in: .whitespaces).count <= 0 ?
|
|
||||||
"채널 소개내용이 없습니다." :
|
|
||||||
introduce)
|
|
||||||
|
|
||||||
Rectangle()
|
|
||||||
.frame(height: 1)
|
|
||||||
.foregroundColor(Color(hex: "909090").opacity(0.5))
|
|
||||||
.padding(.horizontal, 13.3)
|
.padding(.horizontal, 13.3)
|
||||||
}
|
}
|
||||||
.padding(.top, 26.7)
|
|
||||||
|
|
||||||
if creatorProfile.userDonationRanking.count > 0 {
|
|
||||||
VStack(spacing: 26.7) {
|
VStack(spacing: 26.7) {
|
||||||
UserProfileDonationView(userId: userId, donationRankingResponse: creatorProfile.userDonationRanking)
|
let introduce = creatorProfile.creator.introduce
|
||||||
.padding(.horizontal, 13.3)
|
UserProfileIntroduceView(
|
||||||
|
introduce: introduce.trimmingCharacters(in: .whitespaces).count <= 0 ?
|
||||||
|
"채널 소개내용이 없습니다." :
|
||||||
|
introduce)
|
||||||
|
|
||||||
Rectangle()
|
Rectangle()
|
||||||
.frame(height: 6.7)
|
.frame(height: 1)
|
||||||
.foregroundColor(Color.gray90.opacity(0.5))
|
.foregroundColor(Color(hex: "909090").opacity(0.5))
|
||||||
|
.padding(.horizontal, 13.3)
|
||||||
}
|
}
|
||||||
.padding(.top, 26.7)
|
.padding(.top, 26.7)
|
||||||
|
|
||||||
|
if creatorProfile.userDonationRanking.count > 0 {
|
||||||
|
VStack(spacing: 26.7) {
|
||||||
|
UserProfileDonationView(userId: userId, donationRankingResponse: creatorProfile.userDonationRanking)
|
||||||
|
.padding(.horizontal, 13.3)
|
||||||
|
|
||||||
|
Rectangle()
|
||||||
|
.frame(height: 6.7)
|
||||||
|
.foregroundColor(Color.gray90.opacity(0.5))
|
||||||
|
}
|
||||||
|
.padding(.top, 26.7)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UserProfileFanTalkView(
|
UserProfileFanTalkView(
|
||||||
userId: userId,
|
userId: userId,
|
||||||
cheers: creatorProfile.cheers,
|
cheers: creatorProfile.cheers,
|
||||||
|
|
Loading…
Reference in New Issue