라이브 UI 변경

This commit is contained in:
Yu Sung
2024-01-18 17:32:14 +09:00
parent 7ce5a36172
commit 01833fbc1f
37 changed files with 1763 additions and 1135 deletions

View File

@@ -0,0 +1,40 @@
//
// LiveRoomNewChatView.swift
// SodaLive
//
// Created by klaus on 2024/01/18.
//
import SwiftUI
struct LiveRoomNewChatView: View {
let scrollToBottom: () -> Void
var body: some View {
HStack(spacing: 0) {
Spacer()
HStack(spacing: 6.7) {
Image("ic_bottom_white")
Text("새로운 채팅")
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(Color.grayee)
}
.padding(.vertical, 8)
.padding(.horizontal, 13.3)
.background(Color.gray55.opacity(0.8))
.cornerRadius(16.7)
.padding(.bottom, 13.3)
.onTapGesture { scrollToBottom() }
Spacer()
}
}
}
struct LiveRoomNewChatView_Previews: PreviewProvider {
static var previews: some View {
LiveRoomNewChatView {}
}
}

View File

@@ -0,0 +1,43 @@
//
// LiveRoomOverlayStrokeImageButton.swift
// SodaLive
//
// Created by klaus on 2024/01/17.
//
import SwiftUI
struct LiveRoomOverlayStrokeImageButton: View {
let imageName: String
let strokeColor: Color
let strokeWidth: CGFloat
let strokeCornerRadius: CGFloat
let onClick: () -> Void
var body: some View {
Image(imageName)
.padding(4)
.overlay(
RoundedRectangle(cornerRadius: strokeCornerRadius)
.stroke(
strokeColor,
lineWidth: strokeWidth
)
)
.onTapGesture { onClick() }
}
}
struct LiveRoomOverlayStrokeImageButton_Previews: PreviewProvider {
static var previews: some View {
LiveRoomOverlayStrokeImageButton(
imageName: "ic_edit",
strokeColor: Color.graybb,
strokeWidth: 1,
strokeCornerRadius: 5.3,
onClick: {}
)
}
}

View File

@@ -0,0 +1,45 @@
//
// LiveRoomOverlayStrokeTextButton.swift
// SodaLive
//
// Created by klaus on 2024/01/17.
//
import SwiftUI
struct LiveRoomOverlayStrokeTextButton: View {
let text: String
let textColor: Color
let strokeColor: Color
let strokeWidth: CGFloat
let strokeCornerRadius: CGFloat
let onClick: () -> Void
var body: some View {
Text(text)
.font(.custom(Font.medium.rawValue, size: 12))
.foregroundColor(Color.red)
.padding(.horizontal, 8)
.padding(.vertical, 6)
.overlay(
RoundedRectangle(cornerRadius: strokeCornerRadius)
.stroke(strokeColor, lineWidth: strokeWidth)
)
.onTapGesture { onClick() }
}
}
struct LiveRoomOverlayStrokeTextButton_Previews: PreviewProvider {
static var previews: some View {
LiveRoomOverlayStrokeTextButton(
text: "라이브 종료",
textColor: Color.mainRed,
strokeColor: Color.mainRed,
strokeWidth: 1,
strokeCornerRadius: 5.3,
onClick: {}
)
}
}

View File

@@ -0,0 +1,59 @@
//
// LiveRoomOverlayStrokeTextToggleButton.swift
// SodaLive
//
// Created by klaus on 2024/01/17.
//
import SwiftUI
struct LiveRoomOverlayStrokeTextToggleButton: View {
let isOn: Bool
let onText: String
let onTextColor: Color
let onStrokeColor: Color
let offText: String?
let offTextColor: Color
let offStrokeColor: Color
let strokeWidth: CGFloat
let strokeCornerRadius: CGFloat
let onClick: () -> Void
var body: some View {
Text(isOn ? onText : offText != nil && offText?.count ?? 0 > 0 ? offText! : onText)
.font(.custom(Font.medium.rawValue, size: 12))
.foregroundColor(isOn ? onTextColor : offTextColor)
.padding(.horizontal, 8)
.padding(.vertical, 6)
.overlay(
RoundedRectangle(cornerRadius: strokeCornerRadius)
.stroke(
isOn ? onStrokeColor : offStrokeColor,
lineWidth: strokeWidth
)
)
.onTapGesture { onClick() }
}
}
struct LiveRoomOverlayStrokeTextToggleButton_Previews: PreviewProvider {
static var previews: some View {
LiveRoomOverlayStrokeTextToggleButton(
isOn: true,
onText: "배경 ON",
onTextColor: Color.button,
onStrokeColor: Color.button,
offText: "배경 OFF",
offTextColor: Color.grayee,
offStrokeColor: Color.graybb,
strokeWidth: 1,
strokeCornerRadius: 5.3,
onClick: {}
)
}
}

View File

@@ -0,0 +1,33 @@
//
// LiveRoomRightBottomButton.swift
// SodaLive
//
// Created by klaus on 2024/01/17.
//
import SwiftUI
struct LiveRoomRightBottomButton: View {
let imageName: String
let onClick: () -> Void
var body: some View {
Image(imageName)
.resizable()
.frame(width: 24, height: 24)
.padding(10)
.background(Color.gray52.opacity(0.6))
.cornerRadius(10)
.onTapGesture { onClick() }
}
}
struct LiveRoomRightBottomButton_Previews: PreviewProvider {
static var previews: some View {
LiveRoomRightBottomButton(
imageName: "ic_donation",
onClick: {}
)
}
}

View File

@@ -0,0 +1,31 @@
//
// TextView.swift
// SodaLive
//
// Created by klaus on 2024/01/18.
//
import SwiftUI
import UIKit
struct DetectableTextView: UIViewRepresentable {
var text: String
func makeUIView(context: Context) -> UITextView {
let textView = UITextView()
textView.isEditable = false // Make it readonly
textView.backgroundColor = .clear
textView.isScrollEnabled = true
textView.dataDetectorTypes = .link
textView.font = UIFont(name: Font.light.rawValue, size: 11.3)
textView.textColor = .white
textView.textContainer.lineFragmentPadding = 0
textView.textContainerInset = .zero
return textView
}
func updateUIView(_ uiView: UITextView, context: Context) {
uiView.text = text
}
}

View File

@@ -0,0 +1,67 @@
//
// LiveRoomChatView.swift
// SodaLive
//
// Created by klaus on 2024/01/17.
//
import SwiftUI
struct LiveRoomChatView: View {
let messages: [LiveRoomChat]
let getUserProfile: (Int) -> Void
var body: some View {
LazyVStack(alignment: .leading, spacing: 18) {
ForEach(0..<messages.count, id: \.self) { index in
switch (messages[index].type) {
case LiveRoomChatType.ROULETTE_DONATION:
let chatMessage = messages[index] as! LiveRoomRouletteDonationChat
LiveRoomRouletteDonationChatItemView(chatMessage: chatMessage)
case LiveRoomChatType.DONATION:
let chatMessage = messages[index] as! LiveRoomDonationChat
LiveRoomDonationChatItemView(chatMessage: chatMessage)
case LiveRoomChatType.JOIN:
let chatMessage = messages[index] as! LiveRoomJoinChat
LiveRoomJoinChatItemView(chatMessage: chatMessage)
default:
let chatMessage = messages[index] as! LiveRoomNormalChat
LiveRoomChatItemView(
chatMessage: chatMessage,
onClickProfile: {
if chatMessage.userId != UserDefaults.int(forKey: .userId) {
getUserProfile(chatMessage.userId)
}
}
)
}
}
}
}
}
struct LiveRoomChatView_Previews: PreviewProvider {
static var previews: some View {
LiveRoomChatView(
messages: [
LiveRoomRouletteDonationChat(
profileUrl: "https://cf.sodalive.net/profile/26/26-profile-ddf78b4d-0300-4c50-9c84-5d8a95fd5fe2-4892-1705256364320",
nickname: "jkljkljkl",
rouletteResult: "sdfjkldfsjkl",
type: .ROULETTE_DONATION
),
LiveRoomRouletteDonationChat(
profileUrl: "https://cf.sodalive.net/profile/26/26-profile-ddf78b4d-0300-4c50-9c84-5d8a95fd5fe2-4892-1705256364320",
nickname: "jkljkljkl",
rouletteResult: "sdfjkldfsjkl",
type: .ROULETTE_DONATION
)
],
getUserProfile: { _ in }
)
}
}

View File

@@ -0,0 +1,103 @@
//
// LiveRoomInfoCreatorView.swift
// SodaLive
//
// Created by klaus on 2024/01/17.
//
import SwiftUI
import Kingfisher
struct LiveRoomInfoCreatorView: View {
let roomTitle: String
let creatorNickname: String
let creatorProfileUrl: String
let isMute: Bool
let isAdult: Bool
let isFollowing: Bool
let isActiveSpeaker: Bool
let isShowFollowingButton: Bool
let onClickFollow: () -> Void
let onClickProfile: () -> Void
var body: some View {
HStack(spacing: 5.3) {
ZStack(alignment: .center) {
KFImage(URL(string: creatorProfileUrl))
.resizable()
.frame(width: 33.3, height: 33.3)
.clipShape(Circle())
.overlay(
Circle()
.stroke(
Color.button,
lineWidth: isActiveSpeaker ? 3 : 0
)
)
.onTapGesture { onClickProfile() }
if isMute {
Image("ic_mute")
.resizable()
.frame(width: 33.3, height: 33.3)
}
}
VStack(alignment: .leading, spacing: 2.7) {
HStack(spacing: 2.7) {
if isAdult {
Text("19")
.font(.custom(Font.bold.rawValue, size: 8))
.foregroundColor(.white)
.padding(.vertical, 2.8)
.padding(.horizontal, 2)
.background(Circle().foregroundColor(Color.mainRed2))
}
Text(roomTitle)
.font(.custom(Font.bold.rawValue, size: 12))
.foregroundColor(.grayee)
.lineLimit(1)
}
Text(creatorNickname)
.font(.custom(Font.medium.rawValue, size: 12))
.foregroundColor(.gray77)
}
if isShowFollowingButton {
Image(isFollowing ? "btn_select_checked" : "btn_plus_round")
.resizable()
.frame(width: 20, height: 20)
.onTapGesture { onClickFollow() }
}
}
.padding(.vertical, 8)
.padding(.horizontal, 5.3)
.overlay(
RoundedRectangle(cornerRadius: 5.3)
.stroke(Color.graybb, lineWidth: 1)
)
}
}
struct LiveRoomInfoCreatorView_Previews: PreviewProvider {
static var previews: some View {
LiveRoomInfoCreatorView(
roomTitle: "오늘 라이브방송은 OOO 입니다.",
creatorNickname: "도화",
creatorProfileUrl: "https://cf.sodalive.net/profile/26/26-profile-ddf78b4d-0300-4c50-9c84-5d8a95fd5fe2-4892-1705256364320",
isMute: false,
isAdult: false,
isFollowing: true,
isActiveSpeaker: true,
isShowFollowingButton: true,
onClickFollow: {},
onClickProfile: {}
)
}
}

View File

@@ -0,0 +1,190 @@
//
// LiveRoomInfoGuestView.swift
// SodaLive
//
// Created by klaus on 2024/01/17.
//
import SwiftUI
struct LiveRoomInfoGuestView: View {
let title: String
let totalDonationCan: Int
let isOnBg: Bool
let isOnNotice: Bool
let creatorId: Int
let creatorNickname: String
let creatorProfileUrl: String
let speakerList: [LiveRoomMember]
let muteSpeakerList: [UInt]
let activeSpeakerList: [UInt]
let isFollowing: Bool
let isAdult: Bool
let onClickQuit: () -> Void
let onClickToggleBg: () -> Void
let onClickShare: () -> Void
let onClickFollow: (Bool) -> Void
let onClickProfile: (Int) -> Void
let onClickNotice: () -> Void
let onClickTotalDonation: () -> Void
var body: some View {
ZStack {
VStack(spacing: 13.3) {
HStack(spacing: 5.3) {
LiveRoomOverlayStrokeTextButton(
text: "나가기",
textColor: Color.red,
strokeColor: Color.red,
strokeWidth: 1,
strokeCornerRadius: 5.3
) { onClickQuit() }
Spacer()
LiveRoomOverlayStrokeTextToggleButton(
isOn: isOnBg,
onText: "배경 ON",
onTextColor: Color.button,
onStrokeColor: Color.button,
offText: "배경 OFF",
offTextColor: Color.graybb,
offStrokeColor: Color.graybb,
strokeWidth: 1,
strokeCornerRadius: 5.3
) { onClickToggleBg() }
LiveRoomOverlayStrokeImageButton(
imageName: "ic_share",
strokeColor: Color.graybb,
strokeWidth: 1,
strokeCornerRadius: 5.3
) { onClickShare() }
}
HStack(spacing: 8) {
LiveRoomInfoCreatorView(
roomTitle: title,
creatorNickname: creatorNickname,
creatorProfileUrl: creatorProfileUrl,
isMute: muteSpeakerList.contains(UInt(creatorId)),
isAdult: isAdult,
isFollowing: isFollowing,
isActiveSpeaker: activeSpeakerList.contains(UInt(creatorId)),
isShowFollowingButton: true,
onClickFollow: { onClickFollow(isFollowing) },
onClickProfile: { onClickProfile(creatorId) }
)
.frame(width: 180, alignment: .leading)
Spacer()
ForEach(0..<speakerList.count, id: \.self) { index in
let speaker = speakerList[index]
if speaker.id != UInt(creatorId) {
LiveRoomInfoSpeakerView(
nickname: speaker.nickname,
profileUrl: speaker.profileImage,
isMute: muteSpeakerList.contains(UInt(speaker.id)),
isActiveSpeaker: activeSpeakerList.contains(UInt(speaker.id)),
onClickProfile: { onClickProfile(speaker.id) }
)
}
}
}
HStack(spacing: 5.3) {
LiveRoomOverlayStrokeTextToggleButton(
isOn: isOnNotice,
onText: "공지",
onTextColor: .button,
onStrokeColor: .button,
offText: nil,
offTextColor: .graybb,
offStrokeColor: .graybb,
strokeWidth: 1,
strokeCornerRadius: 5.3,
onClick: { onClickNotice() }
)
Spacer()
HStack(spacing: 2.7) {
Image("ic_can")
.resizable()
.frame(width: 12, height: 12)
Text("\(totalDonationCan)")
.font(.custom(Font.medium.rawValue, size: 12))
.foregroundColor(.graybb)
}
.padding(.horizontal, 11)
.padding(.vertical, 5.3)
.overlay(
RoundedRectangle(cornerRadius: 5.3)
.stroke(Color.graybb, lineWidth: 1)
)
.onTapGesture { onClickTotalDonation() }
}
}
if muteSpeakerList.contains(UInt(creatorId)) {
Image("img_noti_mute")
}
}
.padding(.horizontal, 13.3)
.padding(.top, 16)
.background(Color.gray22)
}
}
struct LiveRoomInfoGuestView_Previews: PreviewProvider {
static var previews: some View {
LiveRoomInfoGuestView(
title: "오늘의 라이브방송은 OOO입니다.",
totalDonationCan: 123456,
isOnBg: true,
isOnNotice: false,
creatorId: 1,
creatorNickname: "도화",
creatorProfileUrl: "https://cf.sodalive.net/profile/26/26-profile-ddf78b4d-0300-4c50-9c84-5d8a95fd5fe2-4892-1705256364320",
speakerList: [
LiveRoomMember(
id: 1,
nickname: "도화",
profileImage: "https://cf.sodalive.net/profile/26/26-profile-ddf78b4d-0300-4c50-9c84-5d8a95fd5fe2-4892-1705256364320",
role: .SPEAKER
),
LiveRoomMember(
id: 2,
nickname: "청령",
profileImage: "https://cf.sodalive.net/profile/13/13-profile-fabb75e0-2870-4d99-900e-1d9aa63e605b-685-1704859996417",
role: .SPEAKER
),
LiveRoomMember(
id: 3,
nickname: "LUNA",
profileImage: "https://cf.sodalive.net/profile/4679/4679-profile-41e83399-234e-4541-8591-f961a025cfaa-5819-1699536915310",
role: .SPEAKER
),
],
muteSpeakerList: [],
activeSpeakerList: [],
isFollowing: false,
isAdult: false,
onClickQuit: {},
onClickToggleBg: {},
onClickShare: {},
onClickFollow: { _ in },
onClickProfile: { _ in },
onClickNotice: {},
onClickTotalDonation: {}
)
}
}

View File

@@ -0,0 +1,217 @@
//
// LiveRoomInfoHostView.swift
// SodaLive
//
// Created by klaus on 2024/01/17.
//
import SwiftUI
import Kingfisher
struct LiveRoomInfoHostView: View {
let title: String
let totalDonationCan: Int
let participantsCount: Int
let isOnBg: Bool
let isOnNotice: Bool
let creatorId: Int
let creatorNickname: String
let creatorProfileUrl: String
let speakerList: [LiveRoomMember]
let muteSpeakerList: [UInt]
let activeSpeakerList: [UInt]
let isAdult: Bool
let onClickQuit: () -> Void
let onClickToggleBg: () -> Void
let onClickShare: () -> Void
let onClickEdit: () -> Void
let onClickProfile: (Int) -> Void
let onClickNotice: () -> Void
let onClickTotalDonation: () -> Void
let onClickParticipants: () -> Void
var body: some View {
ZStack {
VStack(alignment: .leading, spacing: 13.3) {
HStack(spacing: 5.3) {
LiveRoomOverlayStrokeTextButton(
text: "라이브 종료",
textColor: Color.red,
strokeColor: Color.red,
strokeWidth: 1,
strokeCornerRadius: 5.3
) { onClickQuit() }
Spacer()
LiveRoomOverlayStrokeTextToggleButton(
isOn: isOnBg,
onText: "배경 ON",
onTextColor: Color.button,
onStrokeColor: Color.button,
offText: "배경 OFF",
offTextColor: Color.graybb,
offStrokeColor: Color.graybb,
strokeWidth: 1,
strokeCornerRadius: 5.3
) { onClickToggleBg() }
LiveRoomOverlayStrokeImageButton(
imageName: "ic_share",
strokeColor: Color.graybb,
strokeWidth: 1,
strokeCornerRadius: 5.3
) { onClickShare() }
LiveRoomOverlayStrokeImageButton(
imageName: "ic_edit",
strokeColor: Color.graybb,
strokeWidth: 1,
strokeCornerRadius: 5.3
) { onClickEdit() }
}
HStack(spacing: 8) {
LiveRoomInfoCreatorView(
roomTitle: title,
creatorNickname: creatorNickname,
creatorProfileUrl: creatorProfileUrl,
isMute: muteSpeakerList.contains(UInt(creatorId)),
isAdult: isAdult,
isFollowing: false,
isActiveSpeaker: activeSpeakerList.contains(UInt(creatorId)),
isShowFollowingButton: false,
onClickFollow: {},
onClickProfile: {}
)
.frame(width: 180, alignment: .leading)
Spacer()
ForEach(0..<speakerList.count, id: \.self) { index in
let speaker = speakerList[index]
if speaker.id != UInt(creatorId) {
LiveRoomInfoSpeakerView(
nickname: speaker.nickname,
profileUrl: speaker.profileImage,
isMute: muteSpeakerList.contains(UInt(speaker.id)),
isActiveSpeaker: activeSpeakerList.contains(UInt(speaker.id)),
onClickProfile: { onClickProfile(speaker.id) }
)
}
}
}
HStack(spacing: 5.3) {
LiveRoomOverlayStrokeTextToggleButton(
isOn: isOnNotice,
onText: "공지",
onTextColor: .button,
onStrokeColor: .button,
offText: nil,
offTextColor: .graybb,
offStrokeColor: .graybb,
strokeWidth: 1,
strokeCornerRadius: 5.3,
onClick: { onClickNotice() }
)
Spacer()
HStack(spacing: 2.7) {
Image("ic_can")
.resizable()
.frame(width: 12, height: 12)
Text("\(totalDonationCan)")
.font(.custom(Font.medium.rawValue, size: 12))
.foregroundColor(.graybb)
}
.padding(.horizontal, 11)
.padding(.vertical, 5.3)
.overlay(
RoundedRectangle(cornerRadius: 5.3)
.stroke(Color.graybb, lineWidth: 1)
)
.onTapGesture { onClickTotalDonation() }
HStack(spacing: 6.7) {
Text("참여자")
.font(.custom(Font.medium.rawValue, size: 12))
.foregroundColor(.graybb)
Text("\(participantsCount)")
.font(.custom(Font.bold.rawValue, size: 12))
.foregroundColor(.graybb)
}
.padding(.horizontal, 11)
.padding(.vertical, 5.3)
.overlay(
RoundedRectangle(cornerRadius: 5.3)
.stroke(Color.graybb, lineWidth: 1)
)
.onTapGesture { onClickParticipants() }
}
}
if muteSpeakerList.contains(UInt(creatorId)) {
Image("img_noti_mute")
}
}
.padding(.horizontal, 13.3)
.padding(.top, 16)
.background(Color.gray22)
}
}
struct LiveRoomInfoHostView_Previews: PreviewProvider {
static var previews: some View {
LiveRoomInfoHostView(
title: "오늘의 라이브방송은 OOO입니다.",
totalDonationCan: 123456,
participantsCount: 18,
isOnBg: true,
isOnNotice: true,
creatorId: 1,
creatorNickname: "도화",
creatorProfileUrl: "https://cf.sodalive.net/profile/26/26-profile-ddf78b4d-0300-4c50-9c84-5d8a95fd5fe2-4892-1705256364320",
speakerList: [
LiveRoomMember(
id: 1,
nickname: "도화",
profileImage: "https://cf.sodalive.net/profile/26/26-profile-ddf78b4d-0300-4c50-9c84-5d8a95fd5fe2-4892-1705256364320",
role: .SPEAKER
),
LiveRoomMember(
id: 2,
nickname: "청령",
profileImage: "https://cf.sodalive.net/profile/13/13-profile-fabb75e0-2870-4d99-900e-1d9aa63e605b-685-1704859996417",
role: .SPEAKER
),
LiveRoomMember(
id: 3,
nickname: "LUNA",
profileImage: "https://cf.sodalive.net/profile/4679/4679-profile-41e83399-234e-4541-8591-f961a025cfaa-5819-1699536915310",
role: .SPEAKER
),
],
muteSpeakerList: [],
activeSpeakerList: [],
isAdult: false,
onClickQuit: {},
onClickToggleBg: {},
onClickShare: {},
onClickEdit: {},
onClickProfile: { _ in },
onClickNotice: {},
onClickTotalDonation: {},
onClickParticipants: {}
)
}
}

View File

@@ -0,0 +1,62 @@
//
// LiveRoomInfoSpeakerView.swift
// SodaLive
//
// Created by klaus on 2024/01/17.
//
import SwiftUI
import Kingfisher
struct LiveRoomInfoSpeakerView: View {
let nickname: String
let profileUrl: String
let isMute: Bool
let isActiveSpeaker: Bool
let onClickProfile: () -> Void
var body: some View {
VStack(spacing: 2.7) {
ZStack(alignment: .center) {
KFImage(URL(string: profileUrl))
.resizable()
.frame(width: 26.7, height: 26.7)
.clipShape(Circle())
.overlay(
Circle()
.stroke(
Color.button,
lineWidth: isActiveSpeaker ? 3 : 0
)
)
if isMute {
Image("ic_mute")
.resizable()
.frame(width: 30, height: 30)
}
}
Text(nickname)
.font(.custom(Font.medium.rawValue, fixedSize: 10.7))
.foregroundColor(.gray77)
}
.frame(width: 30, height: 30)
.onTapGesture { onClickProfile() }
}
}
struct LiveRoomInfoSpeakerView_Previews: PreviewProvider {
static var previews: some View {
LiveRoomInfoSpeakerView(
nickname: "청령",
profileUrl: "https://cf.sodalive.net/profile/13/13-profile-fabb75e0-2870-4d99-900e-1d9aa63e605b-685-1704859996417",
isMute: false,
isActiveSpeaker: true,
onClickProfile: {}
)
}
}

View File

@@ -0,0 +1,55 @@
//
// 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) {
TextField("채팅을 입력하세요", text: $chatMessage)
.autocapitalization(.none)
.disableAutocorrection(true)
.font(.custom(Font.medium.rawValue, size: 13.3))
.foregroundColor(.graybb)
.accentColor(.button)
.keyboardType(.default)
.padding(.horizontal, 13.3)
.padding(.vertical, 18.3)
.background(Color.gray22)
.cornerRadius(5.3)
.frame(maxWidth: .infinity)
.overlay(
RoundedRectangle(cornerRadius: 5.3)
.strokeBorder(lineWidth: 1)
.foregroundColor(.gray77)
)
Image("btn_message_send")
.resizable()
.frame(width: 35, height: 35)
.padding(6.7)
.onTapGesture {
if sendMessage(chatMessage) {
chatMessage = ""
}
}
}
.padding(13.3)
}
}
struct LiveRoomInputChatView_Previews: PreviewProvider {
static var previews: some View {
LiveRoomInputChatView(sendMessage: { _ in return true })
}
}