feat(chat-room): 상단 notice 숨기기 기능 구현
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
//
|
||||
// ChatRoomHeaderView.swift
|
||||
// SodaLive
|
||||
//
|
||||
// Created by klaus on 9/3/25.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct ChatRoomHeaderView: View {
|
||||
var body: some View {
|
||||
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
ChatRoomHeaderView()
|
||||
}
|
||||
@@ -91,6 +91,7 @@ struct ChatRoomView: View {
|
||||
.padding(.vertical, 8)
|
||||
.frame(width: screenSize().width, height: 60)
|
||||
|
||||
if !viewModel.isHideNotice {
|
||||
HStack(spacing: 8) {
|
||||
Image(systemName: "info.circle.fill")
|
||||
.resizable()
|
||||
@@ -108,11 +109,13 @@ struct ChatRoomView: View {
|
||||
.resizable()
|
||||
.scaledToFit()
|
||||
.frame(width: 20)
|
||||
.onTapGesture { viewModel.isHideNotice = true }
|
||||
}
|
||||
.padding(12)
|
||||
.background(Color(hex: "13181B").opacity(0.7))
|
||||
.cornerRadius(16)
|
||||
.frame(width: screenSize().width - 48)
|
||||
}
|
||||
|
||||
GeometryReader { geometry in
|
||||
ScrollViewReader { proxy in
|
||||
|
||||
@@ -22,7 +22,11 @@ final class ChatRoomViewModel: ObservableObject {
|
||||
@Published private(set) var characterName: String = "Character Name"
|
||||
@Published private(set) var characterType: CharacterType = .Character
|
||||
@Published private(set) var chatRoomBgImageUrl: String? = nil
|
||||
@Published private(set) var roomId: Int = 0
|
||||
@Published private(set) var roomId: Int = 0 {
|
||||
didSet {
|
||||
isHideNotice = UserDefaults.standard.bool(forKey: noticeUserDefaultsKey())
|
||||
}
|
||||
}
|
||||
|
||||
@Published private(set) var countdownText: String = "00:00:00"
|
||||
@Published private(set) var showQuotaNoticeView: Bool = false
|
||||
@@ -47,6 +51,11 @@ final class ChatRoomViewModel: ObservableObject {
|
||||
@Published var isShowingChatSettingsView = false
|
||||
@Published var isShowingChangeBgView = false
|
||||
@Published var isShowingChatResetConfirmDialog = false
|
||||
@Published var isHideNotice = false {
|
||||
didSet {
|
||||
UserDefaults.standard.set(isHideNotice, forKey: noticeUserDefaultsKey())
|
||||
}
|
||||
}
|
||||
|
||||
var ownedImageUrls: [String] {
|
||||
return messages
|
||||
@@ -362,6 +371,10 @@ final class ChatRoomViewModel: ObservableObject {
|
||||
chatRoomBgImageId = imageItem.id
|
||||
}
|
||||
|
||||
private func noticeUserDefaultsKey() -> String {
|
||||
return "chat_notice_hidden_room_\(roomId)"
|
||||
}
|
||||
|
||||
private func resetData() {
|
||||
characterProfileUrl = ""
|
||||
characterName = "Character Name"
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
//
|
||||
// DisclaimerView.swift
|
||||
// SodaLive
|
||||
//
|
||||
// Created by klaus on 9/3/25.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct DisclaimerView: View {
|
||||
var body: some View {
|
||||
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
DisclaimerView()
|
||||
}
|
||||
Reference in New Issue
Block a user