74 lines
2.3 KiB
Swift
74 lines
2.3 KiB
Swift
//
|
|
// UserBlockConfirmDialogView.swift
|
|
// SodaLive
|
|
//
|
|
// Created by klaus on 2023/08/11.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct UserBlockConfirmDialogView: View {
|
|
|
|
@Binding var isShowing: Bool
|
|
|
|
let nickname: String
|
|
let confirmAction: () -> Void
|
|
|
|
var notice: String {
|
|
UserDefaults.string(forKey: .role) == MemberRole.CREATOR.rawValue
|
|
? I18n.MemberChannel.blockCreatorNotice(nickname)
|
|
: I18n.MemberChannel.blockListenerNotice(nickname)
|
|
}
|
|
|
|
var body: some View {
|
|
ZStack {
|
|
Color.black
|
|
.opacity(0.7)
|
|
.ignoresSafeArea()
|
|
.onTapGesture { isShowing = false }
|
|
|
|
VStack(spacing: 13.3) {
|
|
Text(I18n.MemberChannel.blockDialogTitle)
|
|
.appFont(size: 16.7, weight: .medium)
|
|
.foregroundColor(.white)
|
|
|
|
Text(I18n.MemberChannel.blockConfirmQuestion(nickname))
|
|
.appFont(size: 13.3, weight: .medium)
|
|
.foregroundColor(.white)
|
|
|
|
HStack(spacing: 0) {
|
|
Text(notice)
|
|
.appFont(size: 13.3, weight: .medium)
|
|
.foregroundColor(.white)
|
|
|
|
Spacer()
|
|
}
|
|
|
|
HStack(spacing: 26.7) {
|
|
Spacer()
|
|
|
|
Text(I18n.Common.cancel)
|
|
.appFont(size: 13.3, weight: .medium)
|
|
.foregroundColor(Color.button)
|
|
.onTapGesture {
|
|
isShowing = false
|
|
}
|
|
|
|
Text(I18n.MemberChannel.blockAction)
|
|
.appFont(size: 13.3, weight: .medium)
|
|
.foregroundColor(Color.button)
|
|
.onTapGesture {
|
|
isShowing = false
|
|
confirmAction()
|
|
}
|
|
}
|
|
.padding(.top, 13.3)
|
|
}
|
|
.padding(24)
|
|
.frame(width: screenSize().width - 33.3)
|
|
.background(Color.gray22)
|
|
.cornerRadius(13.3)
|
|
}
|
|
}
|
|
}
|