feat(chat-settings-view): 대화설정
- 배경 이미지 숨김 - 대화 초기화 기능 추가
This commit is contained in:
@@ -8,11 +8,111 @@
|
||||
import SwiftUI
|
||||
|
||||
struct ChatSettingsView: View {
|
||||
|
||||
@Binding var isShowing: Bool
|
||||
@Binding var isHideBg: Bool
|
||||
|
||||
let onTapChangeBg: () -> Void
|
||||
let onTapResetChatRoom: () -> Void
|
||||
|
||||
var body: some View {
|
||||
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
|
||||
VStack(spacing: 0) {
|
||||
DetailNavigationBar(title: "대화 설정") {
|
||||
isShowing = false
|
||||
}
|
||||
|
||||
ScrollView(.vertical, showsIndicators: false) {
|
||||
VStack(spacing: 0) {
|
||||
VStack(spacing: 0) {
|
||||
Toggle(isOn: $isHideBg) {
|
||||
Text("배경 이미지 숨김")
|
||||
.font(.custom(Font.preBold.rawValue, size: 18))
|
||||
.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("배경 이미지 변경")
|
||||
.font(.custom(Font.preBold.rawValue, size: 18))
|
||||
.foregroundColor(Color(hex: "B0BEC5"))
|
||||
.padding(.horizontal, 24)
|
||||
.padding(.vertical, 12)
|
||||
|
||||
Spacer()
|
||||
}
|
||||
|
||||
Rectangle()
|
||||
.foregroundColor(Color.white.opacity(0.14))
|
||||
.frame(maxWidth: .infinity)
|
||||
.frame(height: 1)
|
||||
}
|
||||
.onTapGesture { onTapChangeBg() }
|
||||
|
||||
HStack(spacing: 0) {
|
||||
VStack(alignment: .leading, spacing: 6) {
|
||||
Text("대화 초기화")
|
||||
.font(.custom(Font.preBold.rawValue, size: 18))
|
||||
.foregroundColor(Color(hex: "B0BEC5"))
|
||||
|
||||
HStack(alignment: .top, spacing: 0) {
|
||||
Text("⚠️ ")
|
||||
.font(.custom(Font.preRegular.rawValue, size: 16))
|
||||
.foregroundColor(.white.opacity(0.7))
|
||||
|
||||
Text("지금까지의 대화가 모두 초기화 되고, 이용자가 새로운 캐릭터가 되어 새롭게 대화를 시작합니다.")
|
||||
.font(.custom(Font.preRegular.rawValue, size: 16))
|
||||
.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")
|
||||
.font(.custom(Font.preBold.rawValue, size: 16))
|
||||
.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)
|
||||
.onTapGesture { onTapResetChatRoom() }
|
||||
}
|
||||
}
|
||||
}
|
||||
.background(Color.black)
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
ChatSettingsView()
|
||||
ChatSettingsView(
|
||||
isShowing: .constant(true),
|
||||
isHideBg: .constant(false),
|
||||
onTapChangeBg: {},
|
||||
onTapResetChatRoom: {}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user