fix(live-room): 채팅창 얼림 버튼 위치와 안내 문구를 조정한다
This commit is contained in:
@@ -784,8 +784,9 @@ enum I18n {
|
||||
static var participants: String { pick(ko: "참여자", en: "Participants", ja: "リスナー") }
|
||||
static var follow: String { pick(ko: "팔로우", en: "Follow", ja: "フォロー") }
|
||||
static var following: String { pick(ko: "팔로잉", en: "Following", ja: "フォロー中") }
|
||||
static var chatFreezeOnStatusMessage: String { pick(ko: "채팅창을 얼렸습니다.", en: "Chat has been frozen.", ja: "チャットが凍結されました。") }
|
||||
static var chatFreezeOffStatusMessage: String { pick(ko: "채팅창 얼림이 해제되었습니다.", en: "Chat freeze has been lifted.", ja: "チャット凍結が解除されました。") }
|
||||
static var chatFreezeOnStatusMessageForCreator: String { pick(ko: "“🧊 모두들 얼음!” 채팅창을 얼렸습니다.", en: "\"🧊 Freeze, everyone!\" The chat has been frozen.", ja: "「🧊 みんなフリーズ!」チャットを凍結しました。") }
|
||||
static var chatFreezeOnStatusMessageForListener: String { pick(ko: "“🧊 모두들 얼음!” 채팅창이 얼었습니다.", en: "\"🧊 Freeze, everyone!\" The chat is now frozen.", ja: "「🧊 みんなフリーズ!」チャットが凍結されました。") }
|
||||
static var chatFreezeOffStatusMessage: String { pick(ko: "“💧땡! “ 채팅창 얼리기가 해제되었습니다.", en: "\"💧 Ding!\" Chat freeze has been lifted.", ja: "「💧 たん!」チャット凍結が解除されました。") }
|
||||
static var chatFreezeBlockedMessage: String { pick(ko: "채팅창이 얼려져 있어 채팅할 수 없습니다.", en: "You cannot chat while chat is frozen.", ja: "チャットが凍結中のため送信できません。") }
|
||||
static var chatDeleteTitle: String { pick(ko: "채팅 삭제", en: "Delete chat", ja: "チャット削除") }
|
||||
}
|
||||
|
||||
@@ -2133,9 +2133,16 @@ final class LiveRoomViewModel: NSObject, ObservableObject {
|
||||
}
|
||||
|
||||
private func appendChatFreezeStatusMessage(isChatFrozen: Bool) {
|
||||
let statusMessage = isChatFrozen
|
||||
? I18n.LiveRoom.chatFreezeOnStatusMessage
|
||||
: I18n.LiveRoom.chatFreezeOffStatusMessage
|
||||
let statusMessage: String
|
||||
|
||||
if isChatFrozen {
|
||||
statusMessage = isCreator
|
||||
? I18n.LiveRoom.chatFreezeOnStatusMessageForCreator
|
||||
: I18n.LiveRoom.chatFreezeOnStatusMessageForListener
|
||||
} else {
|
||||
statusMessage = I18n.LiveRoom.chatFreezeOffStatusMessage
|
||||
}
|
||||
|
||||
messages.append(LiveRoomJoinChat(nickname: "", statusMessage: statusMessage))
|
||||
}
|
||||
|
||||
|
||||
@@ -11,17 +11,20 @@ struct LiveRoomRightBottomButton: View {
|
||||
|
||||
let imageName: String
|
||||
let onClick: () -> Void
|
||||
let backgroundColor: Color?
|
||||
let onLongPress: (() -> Void)?
|
||||
let longPressDuration: Double
|
||||
|
||||
init(
|
||||
imageName: String,
|
||||
onClick: @escaping () -> Void,
|
||||
backgroundColor: Color? = nil,
|
||||
onLongPress: (() -> Void)? = nil,
|
||||
longPressDuration: Double = 2.0
|
||||
) {
|
||||
self.imageName = imageName
|
||||
self.onClick = onClick
|
||||
self.backgroundColor = backgroundColor
|
||||
self.onLongPress = onLongPress
|
||||
self.longPressDuration = longPressDuration
|
||||
}
|
||||
@@ -31,7 +34,15 @@ struct LiveRoomRightBottomButton: View {
|
||||
.resizable()
|
||||
.frame(width: 24, height: 24)
|
||||
.padding(10)
|
||||
.background(Color.gray52.opacity(0.6))
|
||||
.background(
|
||||
backgroundColor ?? Color(
|
||||
.sRGB,
|
||||
red: 82 / 255,
|
||||
green: 82 / 255,
|
||||
blue: 82 / 255,
|
||||
opacity: 0.6
|
||||
)
|
||||
)
|
||||
.cornerRadius(10)
|
||||
.onTapGesture { onClick() }
|
||||
.onLongPressGesture(minimumDuration: longPressDuration) {
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import Kingfisher
|
||||
|
||||
struct LiveRoomInfoHostView: View {
|
||||
|
||||
@@ -19,7 +18,6 @@ struct LiveRoomInfoHostView: View {
|
||||
let isOnNotice: Bool
|
||||
let isOnMenuPan: Bool
|
||||
let isOnSignature: Bool
|
||||
let isOnChatFreeze: Bool
|
||||
let isShowMenuPanButton: Bool
|
||||
|
||||
let creatorId: Int
|
||||
@@ -41,7 +39,6 @@ struct LiveRoomInfoHostView: View {
|
||||
let onClickTotalHeart: () -> Void
|
||||
let onClickTotalDonation: () -> Void
|
||||
let onClickParticipants: () -> Void
|
||||
let onClickToggleChatFreeze: () -> Void
|
||||
let onClickToggleSignature: () -> Void
|
||||
|
||||
var body: some View {
|
||||
@@ -58,18 +55,6 @@ struct LiveRoomInfoHostView: View {
|
||||
|
||||
Spacer()
|
||||
|
||||
LiveRoomOverlayStrokeTextToggleButton(
|
||||
isOn: isOnChatFreeze,
|
||||
onText: I18n.LiveRoom.chatFreezeOn,
|
||||
onTextColor: Color.button,
|
||||
onStrokeColor: Color.button,
|
||||
offText: I18n.LiveRoom.chatFreezeOff,
|
||||
offTextColor: Color.graybb,
|
||||
offStrokeColor: Color.graybb,
|
||||
strokeWidth: 1,
|
||||
strokeCornerRadius: 5.3
|
||||
) { onClickToggleChatFreeze() }
|
||||
|
||||
LiveRoomOverlayStrokeTextToggleButton(
|
||||
isOn: isOnSignature,
|
||||
onText: I18n.LiveRoom.signatureOn,
|
||||
@@ -254,7 +239,6 @@ struct LiveRoomInfoHostView_Previews: PreviewProvider {
|
||||
isOnNotice: true,
|
||||
isOnMenuPan: false,
|
||||
isOnSignature: false,
|
||||
isOnChatFreeze: false,
|
||||
isShowMenuPanButton: false,
|
||||
creatorId: 1,
|
||||
creatorNickname: "도화",
|
||||
@@ -286,7 +270,6 @@ struct LiveRoomInfoHostView_Previews: PreviewProvider {
|
||||
onClickTotalHeart: {},
|
||||
onClickTotalDonation: {},
|
||||
onClickParticipants: {},
|
||||
onClickToggleChatFreeze: {},
|
||||
onClickToggleSignature: {}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -74,7 +74,6 @@ struct LiveRoomViewV2: View {
|
||||
isOnNotice: viewModel.isShowNotice,
|
||||
isOnMenuPan: viewModel.isShowMenuPan,
|
||||
isOnSignature: viewModel.isSignatureOn,
|
||||
isOnChatFreeze: viewModel.isChatFrozen,
|
||||
isShowMenuPanButton: !liveRoomInfo.menuPan.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty,
|
||||
creatorId: liveRoomInfo.creatorId,
|
||||
creatorNickname: liveRoomInfo.creatorNickname,
|
||||
@@ -115,9 +114,6 @@ struct LiveRoomViewV2: View {
|
||||
onClickParticipants: {
|
||||
viewModel.isShowProfileList = true
|
||||
},
|
||||
onClickToggleChatFreeze: {
|
||||
viewModel.setChatFreeze(isChatFrozen: !viewModel.isChatFrozen)
|
||||
},
|
||||
onClickToggleSignature: {
|
||||
viewModel.isSignatureOn.toggle()
|
||||
}
|
||||
@@ -248,11 +244,25 @@ struct LiveRoomViewV2: View {
|
||||
|
||||
VStack(alignment: .trailing, spacing: 0) {
|
||||
Spacer()
|
||||
|
||||
LiveRoomRightBottomButton(
|
||||
imageName: viewModel.isSpeakerMute ? "ic_speaker_off" : "ic_speaker_on",
|
||||
onClick: { viewModel.toggleSpeakerMute() }
|
||||
)
|
||||
|
||||
VStack(spacing: 13.3) {
|
||||
if liveRoomInfo.creatorId == UserDefaults.int(forKey: .userId) {
|
||||
LiveRoomRightBottomButton(
|
||||
imageName: "ic_ice",
|
||||
onClick: {
|
||||
viewModel.setChatFreeze(isChatFrozen: !viewModel.isChatFrozen)
|
||||
},
|
||||
backgroundColor: viewModel.isChatFrozen
|
||||
? Color(hex: "3bb9f1").opacity(0.5)
|
||||
: nil
|
||||
)
|
||||
}
|
||||
|
||||
LiveRoomRightBottomButton(
|
||||
imageName: viewModel.isSpeakerMute ? "ic_speaker_off" : "ic_speaker_on",
|
||||
onClick: { viewModel.toggleSpeakerMute() }
|
||||
)
|
||||
}
|
||||
.padding(.bottom, 40)
|
||||
.padding(.trailing, 13.3)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user