CartView.swift 443 B

123456789101112131415161718192021222324252627
  1. //
  2. // CartView.swift
  3. // SUIExamples
  4. //
  5. // Created by Pavel Yurchenko on 17.08.2024.
  6. //
  7. import SwiftUI
  8. struct CartView: View {
  9. @Environment(CartVM.self) private var vm
  10. var body: some View {
  11. VStack {
  12. Text("Cart")
  13. Spacer()
  14. Button("Products") {
  15. vm.output.onProducts?()
  16. }
  17. }
  18. .padding()
  19. }
  20. }
  21. #Preview {
  22. CartBuilder().build(with: .init())
  23. }