Created
November 1, 2022 08:11
-
-
Save Foreman76/954b03839abaeb68f792a0b5f8846c90 to your computer and use it in GitHub Desktop.
TestScalling.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// BankingScreen.swift | |
// Example | |
// | |
// Created by Danil Kristalev on 30.12.2021. | |
// Copyright © 2021 Exyte. All rights reserved. | |
// | |
import SwiftUI | |
import ScalingHeaderScrollView | |
struct BankingScreen: View { | |
@Environment(\.presentationMode) var presentationMode | |
@State var progress: CGFloat = 0 | |
let service = BankingService() | |
var body: some View { | |
ZStack { | |
ScalingHeaderScrollView { | |
ZStack { | |
Color.hex("#EFF3F5").edgesIgnoringSafeArea(.all) | |
CardView(progress: progress) | |
.padding(.top, 130) | |
.padding(.bottom, 40) | |
} | |
} content: { | |
Color.white.frame(height: 15) | |
ForEach(service.transactions) { transaction in | |
TransactionView(transaction: transaction) | |
} | |
Color.white.frame(height: 15) | |
} | |
.height(min: 220, max: 372) | |
.collapseProgress($progress) | |
.allowsHeaderCollapse() | |
topButtons | |
VStack { | |
Text("Visa Card") | |
.fontRegular(size: 17) | |
.padding(.top, 63) | |
Spacer() | |
} | |
} | |
.ignoresSafeArea() | |
} | |
private var topButtons: some View { | |
VStack { | |
HStack { | |
Button("", action: { self.presentationMode.wrappedValue.dismiss() }) | |
.buttonStyle(CircleButtonStyle(imageName: "arrow.backward", background: .white.opacity(0), width: 50, height: 50)) | |
.padding(.leading, 17) | |
.padding(.top, 50) | |
Spacer() | |
Button("", action: { print("Info") }) | |
.buttonStyle(CircleButtonStyle(imageName: "ellipsis", background: .white.opacity(0), width: 50, height: 50)) | |
.padding(.trailing, 17) | |
.padding(.top, 50) | |
} | |
Spacer() | |
} | |
.ignoresSafeArea() | |
} | |
} | |
struct BankingScreen_Previews: PreviewProvider { | |
static var previews: some View { | |
BankingScreen() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment