Mercurial > public > lazybear
view LazyBear/Views/Home/Helpers/TradingDatesItem.swift @ 424:6dd97877f575
Improve code, reorganize files
author | Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> |
---|---|
date | Sun, 13 Jun 2021 19:40:42 +0200 |
parents | 2984d8946342 |
children | c6913f0ce46e |
line wrap: on
line source
// // TradingDatesItem.swift // LazyBear // // Created by Dennis Concepción Martín on 30/3/21. // import SwiftUI struct TradingDatesItem: View { var date: Date @Environment(\.colorScheme) var colorScheme var body: some View { RoundedRectangle(cornerRadius: 20) .foregroundColor(Color(.secondarySystemBackground)) .frame(width: 100, height: 100) .overlay( VStack { Text(getDateComponents(.month, date)) .fontWeight(.semibold) Text(getDateComponents(.day, date)) .font(.title) .fontWeight(.semibold) .foregroundColor(Color(.systemBlue)) Text(getDateComponents(.year, date)) .font(.caption) .fontWeight(.semibold) } ) } } struct TradingDatesItem_Previews: PreviewProvider { static var previews: some View { TradingDatesItem(date: Date()) } }