라이브 UI 변경
This commit is contained in:
@@ -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 }
|
||||
)
|
||||
}
|
||||
}
|
@@ -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: {}
|
||||
)
|
||||
}
|
||||
}
|
@@ -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: {}
|
||||
)
|
||||
}
|
||||
}
|
@@ -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: {}
|
||||
)
|
||||
}
|
||||
}
|
@@ -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: {}
|
||||
)
|
||||
}
|
||||
}
|
@@ -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 })
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user