comparison About.swift @ 0:668fd7e0d121

first commit
author Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
date Tue, 05 Jan 2021 16:43:09 +0000
parents
children 07410566b51b
comparison
equal deleted inserted replaced
-1:000000000000 0:668fd7e0d121
1 //
2 // Settings.swift
3 // LazyBear
4 //
5 // Created by Dennis Concepción Martín on 27/12/20.
6 //
7
8 import SwiftUI
9
10 struct About: View {
11 @Environment(\.presentationMode) var aboutPresentation
12
13 var body: some View {
14 NavigationView {
15 VStack(alignment:.leading) {
16 AppInfo()
17
18 List {
19 NavigationLink(destination: WhatsNew()
20 .navigationBarTitle("What's new")
21 ) {
22 AboutButton(image: "sparkles", name: "What's new")
23 }
24 Button(action: openUrl(url: "https://apps.apple.com/es/app/lazybear-insider-trading/id1534612943?l=en")) {
25 AboutButton(image: "checkmark.circle.fill", name: "Rate Lazybear")
26 }
27 NavigationLink(destination: TipJar()) {
28 AboutButton(image: "gift.fill", name: "Tip jar")
29 }
30 Button(action: openUrl(url: "https://twitter.com/LazybearApp")) {
31 AboutButton(image: "at.circle.fill", name: "@Lazybear")
32 }
33 Button(action: openUrl(url: "https://twitter.com/dennisconcep")) {
34 AboutButton(image: "at.circle.fill", name: "@DennisConcep")
35 }
36 Button(action: openUrl(url: "https://lazybear.app")) {
37 AboutButton(image: "link.circle.fill", name: "Website")
38 }
39 Button(action: openUrl(url: "https://github.com/denniscm190/lazybear-iOS")) {
40 AboutButton(image: "star.fill", name: "Github")
41 }
42 Button(action: { }) {
43 AboutButton(image: "filemenu.and.selection", name: "Terms & Privacy policy")
44 }
45 Button(action: { }) {
46 AboutButton(image: "envelope.circle.fill", name: "Contact")
47 }
48 }
49 }
50 .padding()
51 .navigationTitle("About")
52 .navigationBarItems(leading:
53 Button(action: {self.aboutPresentation.wrappedValue.dismiss()}) {
54 Image(systemName: "multiply")
55 .resizable()
56 .frame(width: 25, height: 25)
57 }
58 )
59
60 }
61 .navigationViewStyle(StackNavigationViewStyle())
62 }
63
64 func openUrl(url: String) -> () -> () {
65 return {
66 if let url = URL(string: url) {
67 UIApplication.shared.open(url)
68 }
69 }
70 }
71 }
72
73 struct About_Previews: PreviewProvider {
74 static var previews: some View {
75 NavigationView {
76 About()
77 }
78 .navigationViewStyle(StackNavigationViewStyle())
79 }
80 }