# HG changeset patch # User Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> # Date 1614369677 0 # Node ID addb06622ec881861e81572f0c3ff5431150b228 # Parent 5c7a662c2d4ecb64bb8640a0b58ae55ee156bd95 Add SettingRow diff -r 5c7a662c2d4e -r addb06622ec8 LazyBear/UI/SettingRow.swift --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LazyBear/UI/SettingRow.swift Fri Feb 26 20:01:17 2021 +0000 @@ -0,0 +1,36 @@ +// +// SettingRow.swift +// LazyBear +// +// Created by Dennis Concepción Martín on 26/2/21. +// + +import SwiftUI + +struct SettingRow: View { + // Should pass @State because if not preview crashes + @State var image: String + @State var text: String + @State var colour: UIColor + + var body: some View { + HStack { + Image(systemName: image) + .foregroundColor(.white) + .padding(3) + .background(Color(colour) + .cornerRadius(4) + .frame(width: 30, height: 30) + ) + + Text(text) + .padding(.horizontal, 7) + } + } +} + +struct SettingRow_Previews: PreviewProvider { + static var previews: some View { + SettingRow(image: "at", text: "About", colour: .systemBlue) + } +}