Created
May 6, 2021 05:27
-
-
Save eimantas/3c910632b49839b0b05a1872223025f8 to your computer and use it in GitHub Desktop.
galimybių pasas
This file contains hidden or 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
import SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
VStack { | |
ScrollView { | |
VStack(alignment: .leading, spacing: 20) { | |
BannerView() | |
.padding() | |
.frame(maxWidth: .infinity) | |
HStack { | |
Spacer() | |
Image(uiImage: UIImage(named: "hello")!) | |
.resizable() | |
.frame(width: 120, height: 120) | |
Spacer() | |
} | |
VStack(alignment: .leading, spacing: 20) { | |
DetailView(label: "Vardas, pavardė", value: "Eimantas Vaičiūnas") | |
DetailView(label: "Gimimo metai", value: "1984") | |
HStack { | |
DetailView(label: "Išdavimo data", value: "2021-05-05") | |
DetailView(label: "Galioja iki", value: "2021-06-05") | |
} | |
}.frame(maxWidth: .infinity) | |
} | |
} | |
Group { | |
Button( | |
action: {}, | |
label: { | |
Text("Atsisiųsti .PDF") | |
.padding() | |
.background(Color.black) | |
.foregroundColor(.white) | |
.cornerRadius(10) | |
} | |
) | |
} | |
.frame(maxWidth: .infinity, maxHeight: 112) | |
.background(Color.white) | |
}.background(Color(UIColor(named:"BackgroundColor")!)) | |
.ignoresSafeArea() | |
} | |
} | |
struct BannerView: View { | |
var body: some View { | |
HStack(spacing: 10) { | |
Image(systemName: "checkmark").colorInvert() | |
.padding() | |
.background(Color(UIColor(named: "IconColor")!)) | |
.frame(width: 40, height: 40, alignment: .center) | |
.cornerRadius(20) | |
VStack(alignment: .leading) { | |
Text("Žalias galimybių pasas").bold() | |
Text("Kontaktinės veiklos leidžiamos").multilineTextAlignment(.leading) | |
} | |
} | |
.padding() | |
.frame(maxWidth: .infinity) | |
.background(Color(UIColor(named: "BannerColor")!)) | |
.cornerRadius(10) | |
} | |
} | |
struct DetailView: View { | |
let label: String | |
let value: String | |
var body: some View { | |
VStack(alignment: .leading) { | |
Text(label).font(.caption) | |
Text(value).bold() | |
} | |
} | |
} | |
struct ContentView_Previews: PreviewProvider { | |
static var previews: some View { | |
ContentView() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment