Mercurial > public > lazybear
diff LazyBear/Views/Company/Helpers/KeyStatsRow.swift @ 448:f71761f166f2
Handle when data is empty
author | Dennis Concepción Martín <dennisconcepcionmartin@gmail.com> |
---|---|
date | Wed, 23 Jun 2021 11:47:14 +0200 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LazyBear/Views/Company/Helpers/KeyStatsRow.swift Wed Jun 23 11:47:14 2021 +0200 @@ -0,0 +1,38 @@ +// +// KeyStatsRow.swift +// LazyBear +// +// Created by Dennis Concepción Martín on 23/6/21. +// + +import SwiftUI + +struct KeyStatsRow: View { + var label: String + @Environment(\.colorScheme) private var colorScheme + + var body: some View { + HStack { + Text("\(label)") + .font(.callout) + .fontWeight(.semibold) + .lineLimit(1) + + } + .padding() + .background( + Capsule() + .frame(height: 40) + .foregroundColor(Color("customSecondaryBackground")) + .if(colorScheme == .light) { content in + content.shadow(color: Color(.systemGray).opacity(0.25), radius: 10, x: 0.0, y: 0.0) + } + ) + } +} + +struct KeyStatsRow_Previews: PreviewProvider { + static var previews: some View { + KeyStatsRow(label: "Company Name") + } +}