Files
sodalive-ios/SodaLive/Sources/Content/Detail/ContentDetailPurchaseButton.swift
Yu Sung f6ae14d614 콘텐츠 상세
- 소장만, 대여만 가능시 구매하기 버튼 배경색 변경
- 소장만, 대여만 가능시 구매하기 버튼을 터치하면 바로 구매확인 다이얼로그 표시
2024-11-08 21:09:31 +09:00

44 lines
1.2 KiB
Swift

//
// ContentDetailPurchaseButton.swift
// SodaLive
//
// Created by klaus on 2023/08/13.
//
import SwiftUI
struct ContentDetailPurchaseButton: View {
let price: Int
let title: String
let backgroundColor: Color
var body: some View {
HStack(spacing: 0) {
if UserDefaults.int(forKey: .userId) != 17958 {
Image("ic_can")
.resizable()
.frame(width: 16.7, height: 16.7)
}
Text(UserDefaults.int(forKey: .userId) == 17958 ? "\(price * 110)" : "\(price)")
.font(.custom(Font.bold.rawValue, size: 14.7))
.foregroundColor(.white)
.padding(.leading, 5.3)
Text(UserDefaults.int(forKey: .userId) == 17958 ? "원으로": "캔으로")
.font(.custom(Font.light.rawValue, size: 12))
.foregroundColor(.white)
Text(title)
.font(.custom(Font.bold.rawValue, size: 14.7))
.foregroundColor(.white)
}
.frame(maxWidth: .infinity)
.frame(height: 48.7)
.background(backgroundColor)
.cornerRadius(5.3)
.padding(.top, 18.3)
}
}