55 lines
1.4 KiB
Swift
55 lines
1.4 KiB
Swift
//
|
|
// LiveRoomInputChatView.swift
|
|
// SodaLive
|
|
//
|
|
// Created by klaus on 2024/01/17.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct LiveRoomInputChatView: View {
|
|
|
|
@State private var chatMessage = ""
|
|
|
|
|
|
let sendMessage: (String) -> Bool
|
|
|
|
var body: some View {
|
|
HStack(spacing: 6.7) {
|
|
ChatTextFieldView(text: $chatMessage, placeholder: "채팅을 입력하세요") {
|
|
if sendMessage(chatMessage) {
|
|
chatMessage = ""
|
|
}
|
|
}
|
|
.padding(.vertical, 18.3)
|
|
.fixedSize(horizontal: false, vertical: true)
|
|
.frame(maxWidth: .infinity)
|
|
|
|
Image("btn_message_send")
|
|
.resizable()
|
|
.frame(width: 35, height: 35)
|
|
.onTapGesture {
|
|
if sendMessage(chatMessage) {
|
|
chatMessage = ""
|
|
}
|
|
}
|
|
}
|
|
.padding(.leading, 13.3)
|
|
.padding(.trailing, 6.7)
|
|
.background(Color.gray22)
|
|
.cornerRadius(5.3)
|
|
.overlay(
|
|
RoundedRectangle(cornerRadius: 5.3)
|
|
.strokeBorder(lineWidth: 1)
|
|
.foregroundColor(.gray77)
|
|
)
|
|
.padding(13.3)
|
|
}
|
|
}
|
|
|
|
struct LiveRoomInputChatView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
LiveRoomInputChatView(sendMessage: { _ in return true })
|
|
}
|
|
}
|