view LazyBear/Views/Home/Helpers/TopStockItem.swift @ 332:d82e8dd0a828

UI Updates
author Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
date Tue, 30 Mar 2021 23:15:36 +0200
parents 3e64824cca3e
children 2dad5828ccf6
line wrap: on
line source

//
//  TopStockItem.swift
//  LazyBear
//
//  Created by Dennis Concepción Martín on 28/3/21.
//

import SwiftUI

struct TopStockItem: View {
    
    var body: some View {
            RoundedRectangle(cornerRadius: 20)
                .foregroundColor(Color(.secondarySystemBackground))
                .aspectRatio(0.8, contentMode: .fit)
                .clipShape(RoundedRectangle(cornerRadius: 20))
                .overlay(
                    VStack(alignment: .leading) {
                        Group {
                            Text("Symbol".uppercased())
                                .fontWeight(.semibold)
                                .padding(.top)
                            
                            Text("Company name".capitalized)
                                .fontWeight(.semibold)
                                .opacity(0.6)
                            
                            Text("$120.20")
                                .foregroundColor(.green)
                                .fontWeight(.semibold)
                                .padding(.top)
                            
                            Text("+\(1.22, specifier: "%.2f")%")
                                .foregroundColor(.green)
                                .fontWeight(.semibold)
                                
                        }
                        .padding(.horizontal)
                        
                        Spacer()
                         
                        
                        LineView()
                            .foregroundColor(.green)
                            .padding(.vertical)
                            .clipped()
                            
                            
                    }
                )
    }
}

struct TopStockItem_Previews: PreviewProvider {
    static var previews: some View {
        TopStockItem()

    }
}