// // ChatSettingsView.swift // SodaLive // // Created by klaus on 9/3/25. // import SwiftUI struct ChatSettingsView: View { @Binding var isShowing: Bool @Binding var isHideBg: Bool let onTapChangeBg: () -> Void let onTapResetChatRoom: () -> Void var body: some View { VStack(spacing: 0) { DetailNavigationBar(title: I18n.Chat.Room.settingsTitle) { isShowing = false } ScrollView(.vertical, showsIndicators: false) { VStack(spacing: 0) { VStack(spacing: 0) { Toggle(isOn: $isHideBg) { Text(I18n.Chat.Room.hideBackgroundImage) .appFont(size: 18, weight: .bold) .foregroundColor(Color(hex: "B0BEC5")) } .toggleStyle(.switch) .tint(Color.button) .padding(.horizontal, 24) .padding(.vertical, 12) Rectangle() .foregroundColor(Color.white.opacity(0.14)) .frame(maxWidth: .infinity) .frame(height: 1) } VStack(spacing: 0) { HStack { Text(I18n.Chat.Room.changeBackgroundImage) .appFont(size: 18, weight: .bold) .foregroundColor(Color(hex: "B0BEC5")) .padding(.horizontal, 24) .padding(.vertical, 12) Spacer() } Rectangle() .foregroundColor(Color.white.opacity(0.14)) .frame(maxWidth: .infinity) .frame(height: 1) } .contentShape(Rectangle()) .onTapGesture { onTapChangeBg() } HStack(spacing: 0) { VStack(alignment: .leading, spacing: 6) { Text(I18n.Chat.Room.resetConversationTitle) .appFont(size: 18, weight: .bold) .foregroundColor(Color(hex: "B0BEC5")) HStack(alignment: .top, spacing: 0) { Text(I18n.Chat.Room.resetWarningPrefix) .appFont(size: 16, weight: .regular) .foregroundColor(.white.opacity(0.7)) Text(I18n.Chat.Room.resetWarningDescription) .appFont(size: 16, weight: .regular) .foregroundColor(.white.opacity(0.7)) .fixedSize(horizontal: false, vertical: true) } } Spacer() HStack(spacing: 4) { Image("ic_can") .resizable() .frame(width: 24, height: 24) Text("30") .appFont(size: 16, weight: .bold) .foregroundColor(Color(hex: "263238")) } .padding(.vertical, 3) .padding(.horizontal, 10) .background(Color(hex: "B5E7FA")) .cornerRadius(30) .overlay { RoundedRectangle(cornerRadius: 30) .stroke(lineWidth: 1) .foregroundColor(.button) } } .padding(.horizontal, 24) .padding(.vertical, 12) .contentShape(Rectangle()) .onTapGesture { onTapResetChatRoom() } } } } .background(Color.black) } } #Preview { ChatSettingsView( isShowing: .constant(true), isHideBg: .constant(false), onTapChangeBg: {}, onTapResetChatRoom: {} ) }