크리에이터 채널

- 룰렛 설정 메뉴 추가
This commit is contained in:
Yu Sung 2024-10-03 01:15:26 +09:00
parent 6d7e3a40e7
commit 2f734c22ec
4 changed files with 203 additions and 182 deletions

View File

@ -16,14 +16,6 @@ struct UserProfileLiveView: View {
let onClickReservation: (LiveRoomResponse) -> Void let onClickReservation: (LiveRoomResponse) -> Void
var body: some View { var body: some View {
VStack(alignment: .leading, spacing: 26.7) {
HStack(spacing: 0) {
Text("라이브")
.font(.custom(Font.bold.rawValue, size: 16.7))
.foregroundColor(Color(hex: "eeeeee"))
}
VStack(spacing: 13.3) { VStack(spacing: 13.3) {
ForEach(0..<liveRoomList.count, id: \.self) { ForEach(0..<liveRoomList.count, id: \.self) {
let liveRoom = liveRoomList[$0] let liveRoom = liveRoomList[$0]
@ -40,7 +32,7 @@ struct UserProfileLiveView: View {
if !liveRoom.isActive { if !liveRoom.isActive {
Rectangle() Rectangle()
.frame(width: 80, height: 116.7, alignment: .top) .frame(width: 80, height: 116.7, alignment: .top)
.foregroundColor(Color(hex: "909090").opacity(0.5)) .foregroundColor(Color.gray90.opacity(0.5))
.cornerRadius(4.7) .cornerRadius(4.7)
} }
} }
@ -54,12 +46,12 @@ struct UserProfileLiveView: View {
Text(liveRoom.managerNickname) Text(liveRoom.managerNickname)
.font(.custom(Font.medium.rawValue, size: 11.3)) .font(.custom(Font.medium.rawValue, size: 11.3))
.foregroundColor(Color(hex: "bbbbbb")) .foregroundColor(Color.graybb)
.padding(.top, 10) .padding(.top, 10)
Text(liveRoom.title) Text(liveRoom.title)
.font(.custom(Font.medium.rawValue, size: 15.3)) .font(.custom(Font.medium.rawValue, size: 15.3))
.foregroundColor(Color(hex: "e2e2e2")) .foregroundColor(Color.graye2)
.padding(.top, 6.7) .padding(.top, 6.7)
.lineLimit(1) .lineLimit(1)
} }
@ -70,12 +62,12 @@ struct UserProfileLiveView: View {
if liveRoom.channelName != nil { if liveRoom.channelName != nil {
Text("Live") Text("Live")
.font(.custom(Font.medium.rawValue, size: 11.3)) .font(.custom(Font.medium.rawValue, size: 11.3))
.foregroundColor(Color(hex: "ff5c49")) .foregroundColor(Color.mainRed)
.padding(.horizontal, 7) .padding(.horizontal, 7)
.padding(.vertical, 4) .padding(.vertical, 4)
.overlay( .overlay(
RoundedRectangle(cornerRadius: 3.3) RoundedRectangle(cornerRadius: 3.3)
.stroke(Color(hex: "ff5c49"), lineWidth: 1) .stroke(Color.mainRed, lineWidth: 1)
) )
} else { } else {
Text("예정") Text("예정")
@ -91,12 +83,12 @@ struct UserProfileLiveView: View {
} else { } else {
Text("종료") Text("종료")
.font(.custom(Font.medium.rawValue, size: 11.3)) .font(.custom(Font.medium.rawValue, size: 11.3))
.foregroundColor(Color(hex: "777777")) .foregroundColor(Color.gray77)
.padding(.horizontal, 9) .padding(.horizontal, 9)
.padding(.vertical, 4) .padding(.vertical, 4)
.overlay( .overlay(
RoundedRectangle(cornerRadius: 3.3) RoundedRectangle(cornerRadius: 3.3)
.stroke(Color(hex: "777777"), lineWidth: 1) .stroke(Color.gray77, lineWidth: 1)
) )
} }
} }
@ -108,12 +100,12 @@ struct UserProfileLiveView: View {
if liveRoom.isPaid || liveRoom.price <= 0 { if liveRoom.isPaid || liveRoom.price <= 0 {
Text("지금 참여하기") Text("지금 참여하기")
.font(.custom(Font.bold.rawValue, size: 13.3)) .font(.custom(Font.bold.rawValue, size: 13.3))
.foregroundColor(Color(hex: "ffffff")) .foregroundColor(Color.white)
.frame( .frame(
width: screenSize().width - 26.7 - 100, width: screenSize().width - 26.7 - 100,
height: 36.7 height: 36.7
) )
.background(Color(hex: "dd4500")) .background(Color.mainRed3)
.cornerRadius(5.3) .cornerRadius(5.3)
.onTapGesture { .onTapGesture {
onClickParticipant(liveRoom) onClickParticipant(liveRoom)
@ -121,12 +113,12 @@ struct UserProfileLiveView: View {
} else { } else {
Text("\(liveRoom.price)캔으로 지금 참여하기") Text("\(liveRoom.price)캔으로 지금 참여하기")
.font(.custom(Font.bold.rawValue, size: 13.3)) .font(.custom(Font.bold.rawValue, size: 13.3))
.foregroundColor(Color(hex: "ffffff")) .foregroundColor(Color.white)
.frame( .frame(
width: screenSize().width - 26.7 - 100, width: screenSize().width - 26.7 - 100,
height: 36.7 height: 36.7
) )
.background(Color(hex: "dd4500")) .background(Color.mainRed3)
.cornerRadius(5.3) .cornerRadius(5.3)
.onTapGesture { .onTapGesture {
onClickParticipant(liveRoom) onClickParticipant(liveRoom)
@ -136,17 +128,17 @@ struct UserProfileLiveView: View {
if liveRoom.isReservation { if liveRoom.isReservation {
Text("예약완료") Text("예약완료")
.font(.custom(Font.bold.rawValue, size: 13.3)) .font(.custom(Font.bold.rawValue, size: 13.3))
.foregroundColor(Color(hex: "777777")) .foregroundColor(Color.gray77)
.frame( .frame(
width: screenSize().width - 26.7 - 100, width: screenSize().width - 26.7 - 100,
height: 36.7 height: 36.7
) )
.background(Color(hex: "525252")) .background(Color.gray52)
.cornerRadius(5.3) .cornerRadius(5.3)
} else { } else {
Text("\(liveRoom.price > 0 ? "\(liveRoom.price)캔으로 " : "")예약하기") Text("\(liveRoom.price > 0 ? "\(liveRoom.price)캔으로 " : "")예약하기")
.font(.custom(Font.bold.rawValue, size: 13.3)) .font(.custom(Font.bold.rawValue, size: 13.3))
.foregroundColor(Color(hex: "000000")) .foregroundColor(Color.black)
.frame( .frame(
width: screenSize().width - 26.7 - 100, width: screenSize().width - 26.7 - 100,
height: 36.7 height: 36.7
@ -161,12 +153,12 @@ struct UserProfileLiveView: View {
} else { } else {
Text("다시듣기를 지원하지 않습니다") Text("다시듣기를 지원하지 않습니다")
.font(.custom(Font.bold.rawValue, size: 13.3)) .font(.custom(Font.bold.rawValue, size: 13.3))
.foregroundColor(Color(hex: "777777")) .foregroundColor(Color.gray77)
.frame( .frame(
width: screenSize().width - 26.7 - 100, width: screenSize().width - 26.7 - 100,
height: 36.7 height: 36.7
) )
.background(Color(hex: "525252")) .background(Color.gray52)
.cornerRadius(5.3) .cornerRadius(5.3)
} }
} }
@ -175,8 +167,7 @@ struct UserProfileLiveView: View {
Rectangle() Rectangle()
.frame(height: 1) .frame(height: 1)
.foregroundColor(Color(hex: "909090").opacity(0.5)) .foregroundColor(Color.gray90.opacity(0.5))
}
} }
} }
} }

View File

@ -15,6 +15,7 @@ struct UserProfileView: View {
@State private var memberId: Int = 0 @State private var memberId: Int = 0
@State private var isShowMemberProfilePopup: Bool = false @State private var isShowMemberProfilePopup: Bool = false
@State private var isShowFollowNotifyDialog: Bool = false @State private var isShowFollowNotifyDialog: Bool = false
@State private var isShowRouletteSettings: Bool = false
var body: some View { var body: some View {
GeometryReader { proxy in GeometryReader { proxy in
@ -131,6 +132,25 @@ struct UserProfileView: View {
.padding(.horizontal, 13.3) .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 }
}
}
if creatorProfile.liveRoomList.count > 0 { if creatorProfile.liveRoomList.count > 0 {
UserProfileLiveView( UserProfileLiveView(
userId: userId, userId: userId,
@ -155,6 +175,8 @@ struct UserProfileView: View {
} }
} }
) )
}
}
.padding(.top, 26.7) .padding(.top, 26.7)
.padding(.horizontal, 13.3) .padding(.horizontal, 13.3)
} }
@ -339,6 +361,10 @@ struct UserProfileView: View {
} }
) )
} }
if isShowRouletteSettings {
RouletteSettingsView(isShowing: $isShowRouletteSettings, availableActive: false) { _, _ in }
}
} }
.sheet( .sheet(
isPresented: $viewModel.isShowShareView, isPresented: $viewModel.isShowShareView,

View File

@ -13,6 +13,8 @@ struct RouletteSettingsView: View {
@StateObject var viewModel = RouletteSettingsViewModel() @StateObject var viewModel = RouletteSettingsViewModel()
@Binding var isShowing: Bool @Binding var isShowing: Bool
let availableActive: Bool
let onComplete: (Bool, String) -> Void let onComplete: (Bool, String) -> Void
var body: some View { var body: some View {
@ -61,6 +63,7 @@ struct RouletteSettingsView: View {
} }
.padding(.top, 26.7) .padding(.top, 26.7)
if availableActive {
HStack(spacing: 0) { HStack(spacing: 0) {
Text("룰렛을 활성화 하시겠습니까?") Text("룰렛을 활성화 하시겠습니까?")
.font(.custom(Font.bold.rawValue, size: 16)) .font(.custom(Font.bold.rawValue, size: 16))
@ -76,6 +79,7 @@ struct RouletteSettingsView: View {
} }
} }
.padding(.top, 26.7) .padding(.top, 26.7)
}
VStack(alignment: .leading, spacing: 13.3) { VStack(alignment: .leading, spacing: 13.3) {
Text("룰렛 금액 설정") Text("룰렛 금액 설정")
@ -238,6 +242,6 @@ struct RouletteSettingsView: View {
struct RouletteSettingsView_Previews: PreviewProvider { struct RouletteSettingsView_Previews: PreviewProvider {
static var previews: some View { static var previews: some View {
RouletteSettingsView(isShowing: .constant(true)) { _, _ in } RouletteSettingsView(isShowing: .constant(true), availableActive: true) { _, _ in }
} }
} }

View File

@ -610,7 +610,7 @@ struct LiveRoomViewV2: View {
} }
if viewModel.isShowRouletteSettings { if viewModel.isShowRouletteSettings {
RouletteSettingsView(isShowing: $viewModel.isShowRouletteSettings) { isActiveRoulette, message in RouletteSettingsView(isShowing: $viewModel.isShowRouletteSettings, availableActive: true) { isActiveRoulette, message in
self.viewModel.setActiveRoulette( self.viewModel.setActiveRoulette(
isActiveRoulette: isActiveRoulette, isActiveRoulette: isActiveRoulette,
message: message message: message