라이브

- 메뉴판 UI 추가
This commit is contained in:
Yu Sung
2024-03-08 16:58:00 +09:00
parent aa4171b095
commit b6411c3ccb
13 changed files with 381 additions and 123 deletions

View File

@@ -14,6 +14,8 @@ struct LiveRoomInfoGuestView: View {
let isOnBg: Bool
let isOnNotice: Bool
let isOnMenuPan: Bool
let isShowMenuPanButton: Bool
let creatorId: Int
let creatorNickname: String
@@ -31,6 +33,7 @@ struct LiveRoomInfoGuestView: View {
let onClickFollow: (Bool) -> Void
let onClickProfile: (Int) -> Void
let onClickNotice: () -> Void
let onClickMenuPan: () -> Void
let onClickTotalDonation: () -> Void
var body: some View {
@@ -113,6 +116,21 @@ struct LiveRoomInfoGuestView: View {
onClick: { onClickNotice() }
)
if isShowMenuPanButton {
LiveRoomOverlayStrokeTextToggleButton(
isOn: isOnMenuPan,
onText: "메뉴판",
onTextColor: .button,
onStrokeColor: .button,
offText: nil,
offTextColor: .graybb,
offStrokeColor: .graybb,
strokeWidth: 1,
strokeCornerRadius: 5.3,
onClick: { onClickMenuPan() }
)
}
Spacer()
HStack(spacing: 2.7) {
@@ -151,6 +169,8 @@ struct LiveRoomInfoGuestView_Previews: PreviewProvider {
totalDonationCan: 123456,
isOnBg: true,
isOnNotice: false,
isOnMenuPan: false,
isShowMenuPanButton: false,
creatorId: 1,
creatorNickname: "도화",
creatorProfileUrl: "https://cf.sodalive.net/profile/26/26-profile-ddf78b4d-0300-4c50-9c84-5d8a95fd5fe2-4892-1705256364320",
@@ -184,6 +204,7 @@ struct LiveRoomInfoGuestView_Previews: PreviewProvider {
onClickFollow: { _ in },
onClickProfile: { _ in },
onClickNotice: {},
onClickMenuPan: {},
onClickTotalDonation: {}
)
}

View File

@@ -16,6 +16,8 @@ struct LiveRoomInfoHostView: View {
let isOnBg: Bool
let isOnNotice: Bool
let isOnMenuPan: Bool
let isShowMenuPanButton: Bool
let creatorId: Int
let creatorNickname: String
@@ -32,6 +34,7 @@ struct LiveRoomInfoHostView: View {
let onClickEdit: () -> Void
let onClickProfile: (Int) -> Void
let onClickNotice: () -> Void
let onClickMenuPan: () -> Void
let onClickTotalDonation: () -> Void
let onClickParticipants: () -> Void
@@ -122,6 +125,21 @@ struct LiveRoomInfoHostView: View {
onClick: { onClickNotice() }
)
if isShowMenuPanButton {
LiveRoomOverlayStrokeTextToggleButton(
isOn: isOnMenuPan,
onText: "메뉴판",
onTextColor: .button,
onStrokeColor: .button,
offText: nil,
offTextColor: .graybb,
offStrokeColor: .graybb,
strokeWidth: 1,
strokeCornerRadius: 5.3,
onClick: { onClickMenuPan() }
)
}
Spacer()
HStack(spacing: 2.7) {
@@ -178,6 +196,8 @@ struct LiveRoomInfoHostView_Previews: PreviewProvider {
participantsCount: 18,
isOnBg: true,
isOnNotice: true,
isOnMenuPan: false,
isShowMenuPanButton: false,
creatorId: 1,
creatorNickname: "도화",
creatorProfileUrl: "https://cf.sodalive.net/profile/26/26-profile-ddf78b4d-0300-4c50-9c84-5d8a95fd5fe2-4892-1705256364320",
@@ -210,6 +230,7 @@ struct LiveRoomInfoHostView_Previews: PreviewProvider {
onClickEdit: {},
onClickProfile: { _ in },
onClickNotice: {},
onClickMenuPan: {},
onClickTotalDonation: {},
onClickParticipants: {}
)

View File

@@ -29,6 +29,8 @@ struct LiveRoomViewV2: View {
participantsCount: liveRoomInfo.participantsCount,
isOnBg: viewModel.isBgOn,
isOnNotice: viewModel.isShowNotice,
isOnMenuPan: viewModel.isShowMenuPan,
isShowMenuPanButton: !liveRoomInfo.menuPan.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty,
creatorId: liveRoomInfo.creatorId,
creatorNickname: liveRoomInfo.creatorNickname,
creatorProfileUrl: liveRoomInfo.creatorProfileUrl,
@@ -56,6 +58,9 @@ struct LiveRoomViewV2: View {
onClickNotice: {
viewModel.isShowNotice.toggle()
},
onClickMenuPan: {
viewModel.isShowMenuPan.toggle()
},
onClickTotalDonation: {
viewModel.isShowDonationRankingPopup = true
},
@@ -69,6 +74,8 @@ struct LiveRoomViewV2: View {
totalDonationCan: viewModel.totalDonationCan,
isOnBg: viewModel.isBgOn,
isOnNotice: viewModel.isShowNotice,
isOnMenuPan: viewModel.isShowMenuPan,
isShowMenuPanButton: !liveRoomInfo.menuPan.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty,
creatorId: liveRoomInfo.creatorId,
creatorNickname: liveRoomInfo.creatorNickname,
creatorProfileUrl: liveRoomInfo.creatorProfileUrl,
@@ -101,6 +108,9 @@ struct LiveRoomViewV2: View {
onClickNotice: {
viewModel.isShowNotice.toggle()
},
onClickMenuPan: {
viewModel.isShowMenuPan.toggle()
},
onClickTotalDonation: {
viewModel.isShowDonationRankingPopup = true
}
@@ -293,6 +303,28 @@ struct LiveRoomViewV2: View {
.padding(.bottom, 120)
}
}
if viewModel.isShowMenuPan {
VStack(alignment: .leading, spacing: 0) {
Image("ic_notice_triangle")
.padding(.leading, 60)
VStack(alignment: .leading, spacing: 8) {
Text("[메뉴판]")
.font(.custom(Font.bold.rawValue, size: 11.3))
.foregroundColor(.white)
Text(liveRoomInfo.menuPan)
.font(.custom(Font.light.rawValue, size: 11.3))
.foregroundColor(.white)
.lineSpacing(4)
}
.padding(8)
.background(Color.gray33)
.padding(.horizontal, 60)
.padding(.bottom, 120)
}
}
}
}
}