feat(live-room): 라이브룸 채팅 삭제 기능 구현
This commit is contained in:
@@ -16,6 +16,7 @@ protocol LiveRoomChat {
|
||||
}
|
||||
|
||||
struct LiveRoomNormalChat: LiveRoomChat {
|
||||
let chatId: String
|
||||
let userId: Int
|
||||
let profileUrl: String
|
||||
let nickname: String
|
||||
@@ -37,6 +38,7 @@ struct LiveRoomDonationChat: LiveRoomChat {
|
||||
}
|
||||
|
||||
struct LiveRoomRouletteDonationChat: LiveRoomChat {
|
||||
let memberId: Int
|
||||
let profileUrl: String
|
||||
let nickname: String
|
||||
let rouletteResult: String
|
||||
|
||||
@@ -12,6 +12,7 @@ struct LiveRoomChatItemView: View {
|
||||
|
||||
let chatMessage: LiveRoomNormalChat
|
||||
let onClickProfile: () -> Void
|
||||
let onLongPressChat: (() -> Void)?
|
||||
|
||||
private var rankValue: Int {
|
||||
chatMessage.rank + 1
|
||||
@@ -132,6 +133,9 @@ struct LiveRoomChatItemView: View {
|
||||
Color.black.opacity(0.6)
|
||||
)
|
||||
.cornerRadius(3.3)
|
||||
.onLongPressGesture {
|
||||
onLongPressChat?()
|
||||
}
|
||||
}
|
||||
.frame(width: screenSize().width - 86, alignment: .leading)
|
||||
.padding(.leading, 20)
|
||||
|
||||
@@ -10,7 +10,7 @@ import Foundation
|
||||
struct LiveRoomChatRawMessage: Codable {
|
||||
enum LiveRoomChatRawMessageType: String, Codable {
|
||||
case DONATION, SECRET_DONATION, EDIT_ROOM_INFO, SET_MANAGER, TOGGLE_ROULETTE, TOGGLE_CHAT_FREEZE, ROULETTE_DONATION
|
||||
case HEART_DONATION, BIG_HEART_DONATION
|
||||
case HEART_DONATION, BIG_HEART_DONATION, NORMAL_CHAT, DELETE_CHAT, DELETE_CHAT_BY_USER
|
||||
}
|
||||
|
||||
let type: LiveRoomChatRawMessageType
|
||||
@@ -21,4 +21,6 @@ struct LiveRoomChatRawMessage: Codable {
|
||||
let donationMessage: String?
|
||||
var isActiveRoulette: Bool? = nil
|
||||
var isChatFrozen: Bool? = nil
|
||||
var chatId: String? = nil
|
||||
var targetUserId: Int? = nil
|
||||
}
|
||||
|
||||
@@ -66,6 +66,6 @@ struct LiveRoomRouletteDonationChatItemView: View {
|
||||
|
||||
struct LiveRoomRouletteDonationChatItemView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
LiveRoomRouletteDonationChatItemView(chatMessage: LiveRoomRouletteDonationChat(profileUrl: "", nickname: "유저일", rouletteResult: "옵션1"))
|
||||
LiveRoomRouletteDonationChatItemView(chatMessage: LiveRoomRouletteDonationChat(memberId: 0, profileUrl: "", nickname: "유저일", rouletteResult: "옵션1"))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user