view LazyBear/Views/Home/Helpers/TradingDatesItem.swift @ 449:4255f94d0767

Minor updates
author Dennis Concepción Martín <dennisconcepcionmartin@gmail.com>
date Wed, 23 Jun 2021 13:03:00 +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())
    }
}