48 lines
1.3 KiB
Swift
48 lines
1.3 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)")
|
|
.appFont(size: 14.7, weight: .bold)
|
|
.foregroundColor(.white)
|
|
.padding(.leading, 5.3)
|
|
|
|
Text(
|
|
UserDefaults.int(forKey: .userId) == 17958 ?
|
|
I18n.ContentDetail.Purchase.withWon :
|
|
I18n.ContentDetail.Purchase.withCan
|
|
)
|
|
.appFont(size: 12, weight: .light)
|
|
.foregroundColor(.white)
|
|
|
|
Text(title)
|
|
.appFont(size: 14.7, weight: .bold)
|
|
.foregroundColor(.white)
|
|
}
|
|
.frame(maxWidth: .infinity)
|
|
.frame(height: 48.7)
|
|
.background(backgroundColor)
|
|
.cornerRadius(5.3)
|
|
.padding(.top, 18.3)
|
|
}
|
|
}
|