44 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Swift
		
	
	
	
	
	
			
		
		
	
	
			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)
 | 
						|
    }
 | 
						|
}
 |