Mercurial > public > lazybear
changeset 406:09d05e48462f
Change design TradingDateItem
author | Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> |
---|---|
date | Sat, 05 Jun 2021 19:05:13 +0200 |
parents | fd8df65927e9 |
children | c804ce7a1560 |
files | LazyBear/Views/Home/Helpers/TradingDatesItem.swift LazyBear/Views/Home/TradingDates.swift |
diffstat | 2 files changed, 14 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- a/LazyBear/Views/Home/Helpers/TradingDatesItem.swift Sat Jun 05 19:04:44 2021 +0200 +++ b/LazyBear/Views/Home/Helpers/TradingDatesItem.swift Sat Jun 05 19:05:13 2021 +0200 @@ -14,36 +14,21 @@ var body: some View { RoundedRectangle(cornerRadius: 20) .foregroundColor(Color(.secondarySystemBackground)) - .frame(height: 100) + .frame(width: 100, height: 100) .overlay( - HStack { - Rectangle() - .frame(width: 15) + VStack { + Text(get(.month)) + .fontWeight(.semibold) + + Text(get(.day)) + .font(.title) + .fontWeight(.semibold) .foregroundColor(Color("default")) - - VStack { - Text(get(.month)) - .fontWeight(.semibold) - - Text(get(.day)) - .font(.title) - .fontWeight(.semibold) - .foregroundColor(Color("default")) - - Text(get(.year)) - .font(.caption) - .fontWeight(.semibold) - } - Spacer() - VStack { - Text("US Markets are closed") - .fontWeight(.semibold) - } - - Spacer() + Text(get(.year)) + .font(.caption) + .fontWeight(.semibold) } - .clipShape(RoundedRectangle(cornerRadius: 20)) ) }
--- a/LazyBear/Views/Home/TradingDates.swift Sat Jun 05 19:04:44 2021 +0200 +++ b/LazyBear/Views/Home/TradingDates.swift Sat Jun 05 19:05:13 2021 +0200 @@ -12,10 +12,12 @@ var dates: [TradingDatesModel] @Environment(\.presentationMode) var tradingDatesPresent + let columns = [GridItem(.adaptive(minimum: 100))] + var body: some View { NavigationView { ScrollView { - VStack(spacing: 20) { + LazyVGrid(columns: columns, spacing: 20) { ForEach(getArrayOfDates(), id: \.self) { date in TradingDatesItem(date: date) }