Mercurial > public > lazybear
view lazybear/Views/Placeholder.swift @ 136:867cc725c6a5
Comment code
author | Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> |
---|---|
date | Wed, 10 Feb 2021 20:45:58 +0100 |
parents | d3468ac3ecc6 |
children |
line wrap: on
line source
// // HistoryPlaceholder.swift // LazyBear // // Created by Dennis Concepción Martín on 8/2/21. // import SwiftUI /* Placeholder when some lists are empty, such as HistoryList and WachtList */ struct Placeholder: View { @State var title: String @State var text: String? var body: some View { VStack(alignment: .center) { Text(title) Text(text ?? "") } .font(.body) .opacity(0.5) } } struct HistoryPlaceholder_Previews: PreviewProvider { static var previews: some View { Placeholder(title: "Try to search something!", text: "For example, type 'Apple' in the search bar") } }