117 lines
4.1 KiB
Swift
117 lines
4.1 KiB
Swift
//
|
|
// LivePaymentDialog.swift
|
|
// SodaLive
|
|
//
|
|
// Created by klaus on 1/21/24.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct LivePaymentDialog: View {
|
|
|
|
let title: String
|
|
let desc: String
|
|
let desc2: String?
|
|
let confirmButtonTitle: String
|
|
let confirmButtonAction: () -> Void
|
|
let cancelButtonTitle: String
|
|
let cancelButtonAction: () -> Void
|
|
|
|
let startDateTime: String?
|
|
let nowDateTime: String?
|
|
|
|
var body: some View {
|
|
VStack {
|
|
Text(title)
|
|
.appFont(size: 18.3, weight: .bold)
|
|
.foregroundColor(Color.graybb)
|
|
|
|
Text(desc)
|
|
.appFont(size: 15, weight: .medium)
|
|
.foregroundColor(Color.graybb)
|
|
.multilineTextAlignment(.center)
|
|
.lineSpacing(6)
|
|
.padding(.top, 21.3)
|
|
|
|
if let startDateTime = startDateTime, let nowDateTime = nowDateTime, let desc = desc2 {
|
|
VStack(spacing: 13.3) {
|
|
HStack(spacing: 6.7) {
|
|
Text(I18n.Dialog.LivePayment.startTimePrefix)
|
|
.appFont(size: 13.3, weight: .medium)
|
|
.foregroundColor(Color.graybb)
|
|
|
|
Text(startDateTime)
|
|
.appFont(size: 13.3, weight: .medium)
|
|
.foregroundColor(Color.graybb)
|
|
}
|
|
|
|
HStack(spacing: 6.7) {
|
|
Text(I18n.Dialog.LivePayment.currentTimePrefix)
|
|
.appFont(size: 13.3, weight: .medium)
|
|
.foregroundColor(Color.graybb)
|
|
.multilineTextAlignment(.leading)
|
|
|
|
Text(nowDateTime)
|
|
.appFont(size: 13.3, weight: .medium)
|
|
.foregroundColor(Color.graybb)
|
|
}
|
|
}
|
|
.padding(.vertical, 13.3)
|
|
.padding(.horizontal, 26.7)
|
|
.background(Color.gray30)
|
|
.cornerRadius(13.3)
|
|
.padding(.top, 21.3)
|
|
|
|
Text(desc)
|
|
.appFont(size: 15, weight: .medium)
|
|
.foregroundColor(Color.graybb)
|
|
.lineSpacing(6)
|
|
.padding(.top, 21.3)
|
|
}
|
|
|
|
HStack(spacing: 13.3) {
|
|
Text(cancelButtonTitle)
|
|
.appFont(size: 18.3, weight: .bold)
|
|
.foregroundColor(Color.button)
|
|
.padding(.vertical, 16)
|
|
.frame(maxWidth: .infinity)
|
|
.background(Color.bg)
|
|
.cornerRadius(10)
|
|
.overlay(
|
|
RoundedRectangle(cornerRadius: 8)
|
|
.stroke(Color(hex: "3bb9f1"), lineWidth: 1)
|
|
)
|
|
.onTapGesture { cancelButtonAction() }
|
|
|
|
Text(confirmButtonTitle)
|
|
.appFont(size: 18.3, weight: .bold)
|
|
.padding(.vertical, 16)
|
|
.frame(maxWidth: .infinity)
|
|
.background(Color.button)
|
|
.cornerRadius(10)
|
|
.onTapGesture { confirmButtonAction() }
|
|
}
|
|
.padding(.top, 45)
|
|
}
|
|
.padding(.horizontal, 16.7)
|
|
.padding(.bottom, 16.7)
|
|
.padding(.top, 40)
|
|
.background(Color(hex: "222222"))
|
|
.cornerRadius(10)
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
LivePaymentDialog(
|
|
title: "유료 라이브 입장",
|
|
desc: "OO캔을 차감하고\n라이브에 입장 하시겠습니까?",
|
|
desc2: "라이브가 시작한 지 1시간 10분이 지났습니다. 라이브에 입장 후 30분 이내에 라이브가 종료될 수도 있습니다.",
|
|
confirmButtonTitle: I18n.MemberChannel.paidLiveConfirmTitle,
|
|
confirmButtonAction: {},
|
|
cancelButtonTitle: I18n.Common.cancel,
|
|
cancelButtonAction: {},
|
|
startDateTime: "2024-01-01 15:00",
|
|
nowDateTime: "2024-01-02 15:00"
|
|
)
|
|
}
|