2025-05-26 21:07:50 +07:00

51 lines
1.2 KiB
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// SwiftUIView.swift
// UIKitComponents
//
// Created by User on 26.05.2025.
//
import SwiftUI
public struct CartButtonView: View {
let price: Int
let title: String
let action: () -> ()
public init(price: Int, title: String, action: @escaping () -> Void) {
self.price = price
self.title = title
self.action = action
}
public var body: some View {
ZStack {
CustomMainButtonView(title: "") {
action()
}
HStack {
Image("cart", bundle: .module)
.padding(.horizontal, 16)
Text(title)
.robotoFlex(size: 17, font: .bold)
.foregroundStyle(Color.white)
.tracking(0)
.lineSpacing(24)
Spacer()
Text("\(price)")
.foregroundStyle(Color.white)
.robotoFlex(size: 17, font: .bold)
Image("Rouble", bundle: .module)
.padding(.trailing, 16)
}
}
}
}
#Preview {
CartButtonView(price: 500, title: "В корзину") {
}
}