Mercurial > public > lazybear
comparison LazyBear/Views/Home/Helpers/TradingDatesSheet.swift @ 443:ffbb1dbab531
InsiderRosterHelper implemented
author | Dennis Concepción Martín <dennisconcepcionmartin@gmail.com> |
---|---|
date | Mon, 21 Jun 2021 20:17:46 +0200 |
parents | LazyBear/Views/Home/TradingDates.swift@c78d5b5b3bda |
children |
comparison
equal
deleted
inserted
replaced
442:6eae10397501 | 443:ffbb1dbab531 |
---|---|
1 // | |
2 // TradingDateSheet.swift | |
3 // LazyBear | |
4 // | |
5 // Created by Dennis Concepción Martín on 30/3/21. | |
6 // | |
7 | |
8 import SwiftUI | |
9 | |
10 | |
11 struct TradingDatesSheet: View { | |
12 var dates: [String] | |
13 @Environment(\.presentationMode) private var tradingDatesPresentation | |
14 | |
15 let columns = [GridItem(.adaptive(minimum: 100))] | |
16 | |
17 var body: some View { | |
18 NavigationView { | |
19 ScrollView { | |
20 LazyVGrid(columns: columns, spacing: 20) { | |
21 ForEach(dates, id: \.self) { date in | |
22 TradingDatesItem(date: convertStringToDate(date)) | |
23 } | |
24 } | |
25 .padding() | |
26 } | |
27 .navigationTitle("Holiday dates") | |
28 .toolbar { | |
29 ToolbarItem(placement: .navigationBarLeading) { | |
30 Button(action: { tradingDatesPresentation.wrappedValue.dismiss() }) { | |
31 Image(systemName: "multiply") | |
32 .imageScale(.large) | |
33 } | |
34 } | |
35 } | |
36 } | |
37 } | |
38 } | |
39 | |
40 struct TradingDate_Previews: PreviewProvider { | |
41 static var previews: some View { | |
42 // Format is YYYY-MM-DD | |
43 TradingDatesSheet(dates: ["2021-01-01"]) | |
44 } | |
45 } |