parent
6d7e3a40e7
commit
2f734c22ec
|
@ -16,14 +16,6 @@ struct UserProfileLiveView: View {
|
|||
let onClickReservation: (LiveRoomResponse) -> Void
|
||||
|
||||
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) {
|
||||
ForEach(0..<liveRoomList.count, id: \.self) {
|
||||
let liveRoom = liveRoomList[$0]
|
||||
|
@ -40,7 +32,7 @@ struct UserProfileLiveView: View {
|
|||
if !liveRoom.isActive {
|
||||
Rectangle()
|
||||
.frame(width: 80, height: 116.7, alignment: .top)
|
||||
.foregroundColor(Color(hex: "909090").opacity(0.5))
|
||||
.foregroundColor(Color.gray90.opacity(0.5))
|
||||
.cornerRadius(4.7)
|
||||
}
|
||||
}
|
||||
|
@ -54,12 +46,12 @@ struct UserProfileLiveView: View {
|
|||
|
||||
Text(liveRoom.managerNickname)
|
||||
.font(.custom(Font.medium.rawValue, size: 11.3))
|
||||
.foregroundColor(Color(hex: "bbbbbb"))
|
||||
.foregroundColor(Color.graybb)
|
||||
.padding(.top, 10)
|
||||
|
||||
Text(liveRoom.title)
|
||||
.font(.custom(Font.medium.rawValue, size: 15.3))
|
||||
.foregroundColor(Color(hex: "e2e2e2"))
|
||||
.foregroundColor(Color.graye2)
|
||||
.padding(.top, 6.7)
|
||||
.lineLimit(1)
|
||||
}
|
||||
|
@ -70,12 +62,12 @@ struct UserProfileLiveView: View {
|
|||
if liveRoom.channelName != nil {
|
||||
Text("Live")
|
||||
.font(.custom(Font.medium.rawValue, size: 11.3))
|
||||
.foregroundColor(Color(hex: "ff5c49"))
|
||||
.foregroundColor(Color.mainRed)
|
||||
.padding(.horizontal, 7)
|
||||
.padding(.vertical, 4)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: 3.3)
|
||||
.stroke(Color(hex: "ff5c49"), lineWidth: 1)
|
||||
.stroke(Color.mainRed, lineWidth: 1)
|
||||
)
|
||||
} else {
|
||||
Text("예정")
|
||||
|
@ -91,12 +83,12 @@ struct UserProfileLiveView: View {
|
|||
} else {
|
||||
Text("종료")
|
||||
.font(.custom(Font.medium.rawValue, size: 11.3))
|
||||
.foregroundColor(Color(hex: "777777"))
|
||||
.foregroundColor(Color.gray77)
|
||||
.padding(.horizontal, 9)
|
||||
.padding(.vertical, 4)
|
||||
.overlay(
|
||||
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 {
|
||||
Text("지금 참여하기")
|
||||
.font(.custom(Font.bold.rawValue, size: 13.3))
|
||||
.foregroundColor(Color(hex: "ffffff"))
|
||||
.foregroundColor(Color.white)
|
||||
.frame(
|
||||
width: screenSize().width - 26.7 - 100,
|
||||
height: 36.7
|
||||
)
|
||||
.background(Color(hex: "dd4500"))
|
||||
.background(Color.mainRed3)
|
||||
.cornerRadius(5.3)
|
||||
.onTapGesture {
|
||||
onClickParticipant(liveRoom)
|
||||
|
@ -121,12 +113,12 @@ struct UserProfileLiveView: View {
|
|||
} else {
|
||||
Text("\(liveRoom.price)캔으로 지금 참여하기")
|
||||
.font(.custom(Font.bold.rawValue, size: 13.3))
|
||||
.foregroundColor(Color(hex: "ffffff"))
|
||||
.foregroundColor(Color.white)
|
||||
.frame(
|
||||
width: screenSize().width - 26.7 - 100,
|
||||
height: 36.7
|
||||
)
|
||||
.background(Color(hex: "dd4500"))
|
||||
.background(Color.mainRed3)
|
||||
.cornerRadius(5.3)
|
||||
.onTapGesture {
|
||||
onClickParticipant(liveRoom)
|
||||
|
@ -136,17 +128,17 @@ struct UserProfileLiveView: View {
|
|||
if liveRoom.isReservation {
|
||||
Text("예약완료")
|
||||
.font(.custom(Font.bold.rawValue, size: 13.3))
|
||||
.foregroundColor(Color(hex: "777777"))
|
||||
.foregroundColor(Color.gray77)
|
||||
.frame(
|
||||
width: screenSize().width - 26.7 - 100,
|
||||
height: 36.7
|
||||
)
|
||||
.background(Color(hex: "525252"))
|
||||
.background(Color.gray52)
|
||||
.cornerRadius(5.3)
|
||||
} else {
|
||||
Text("\(liveRoom.price > 0 ? "\(liveRoom.price)캔으로 " : "")예약하기")
|
||||
.font(.custom(Font.bold.rawValue, size: 13.3))
|
||||
.foregroundColor(Color(hex: "000000"))
|
||||
.foregroundColor(Color.black)
|
||||
.frame(
|
||||
width: screenSize().width - 26.7 - 100,
|
||||
height: 36.7
|
||||
|
@ -161,12 +153,12 @@ struct UserProfileLiveView: View {
|
|||
} else {
|
||||
Text("다시듣기를 지원하지 않습니다")
|
||||
.font(.custom(Font.bold.rawValue, size: 13.3))
|
||||
.foregroundColor(Color(hex: "777777"))
|
||||
.foregroundColor(Color.gray77)
|
||||
.frame(
|
||||
width: screenSize().width - 26.7 - 100,
|
||||
height: 36.7
|
||||
)
|
||||
.background(Color(hex: "525252"))
|
||||
.background(Color.gray52)
|
||||
.cornerRadius(5.3)
|
||||
}
|
||||
}
|
||||
|
@ -175,8 +167,7 @@ struct UserProfileLiveView: View {
|
|||
|
||||
Rectangle()
|
||||
.frame(height: 1)
|
||||
.foregroundColor(Color(hex: "909090").opacity(0.5))
|
||||
}
|
||||
.foregroundColor(Color.gray90.opacity(0.5))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ struct UserProfileView: View {
|
|||
@State private var memberId: Int = 0
|
||||
@State private var isShowMemberProfilePopup: Bool = false
|
||||
@State private var isShowFollowNotifyDialog: Bool = false
|
||||
@State private var isShowRouletteSettings: Bool = false
|
||||
|
||||
var body: some View {
|
||||
GeometryReader { proxy in
|
||||
|
@ -131,6 +132,25 @@ struct UserProfileView: View {
|
|||
.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 {
|
||||
UserProfileLiveView(
|
||||
userId: userId,
|
||||
|
@ -155,6 +175,8 @@ struct UserProfileView: View {
|
|||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
.padding(.top, 26.7)
|
||||
.padding(.horizontal, 13.3)
|
||||
}
|
||||
|
@ -339,6 +361,10 @@ struct UserProfileView: View {
|
|||
}
|
||||
)
|
||||
}
|
||||
|
||||
if isShowRouletteSettings {
|
||||
RouletteSettingsView(isShowing: $isShowRouletteSettings, availableActive: false) { _, _ in }
|
||||
}
|
||||
}
|
||||
.sheet(
|
||||
isPresented: $viewModel.isShowShareView,
|
||||
|
|
|
@ -13,6 +13,8 @@ struct RouletteSettingsView: View {
|
|||
@StateObject var viewModel = RouletteSettingsViewModel()
|
||||
|
||||
@Binding var isShowing: Bool
|
||||
|
||||
let availableActive: Bool
|
||||
let onComplete: (Bool, String) -> Void
|
||||
|
||||
var body: some View {
|
||||
|
@ -61,6 +63,7 @@ struct RouletteSettingsView: View {
|
|||
}
|
||||
.padding(.top, 26.7)
|
||||
|
||||
if availableActive {
|
||||
HStack(spacing: 0) {
|
||||
Text("룰렛을 활성화 하시겠습니까?")
|
||||
.font(.custom(Font.bold.rawValue, size: 16))
|
||||
|
@ -76,6 +79,7 @@ struct RouletteSettingsView: View {
|
|||
}
|
||||
}
|
||||
.padding(.top, 26.7)
|
||||
}
|
||||
|
||||
VStack(alignment: .leading, spacing: 13.3) {
|
||||
Text("룰렛 금액 설정")
|
||||
|
@ -238,6 +242,6 @@ struct RouletteSettingsView: View {
|
|||
|
||||
struct RouletteSettingsView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
RouletteSettingsView(isShowing: .constant(true)) { _, _ in }
|
||||
RouletteSettingsView(isShowing: .constant(true), availableActive: true) { _, _ in }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -610,7 +610,7 @@ struct LiveRoomViewV2: View {
|
|||
}
|
||||
|
||||
if viewModel.isShowRouletteSettings {
|
||||
RouletteSettingsView(isShowing: $viewModel.isShowRouletteSettings) { isActiveRoulette, message in
|
||||
RouletteSettingsView(isShowing: $viewModel.isShowRouletteSettings, availableActive: true) { isActiveRoulette, message in
|
||||
self.viewModel.setActiveRoulette(
|
||||
isActiveRoulette: isActiveRoulette,
|
||||
message: message
|
||||
|
|
Loading…
Reference in New Issue