Mercurial > public > geoquiz
comparison GeoQuiz/Helpers/SettingsRow.swift @ 27:3f4b366d476d
add flag layout settings
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Thu, 10 Nov 2022 09:26:48 +0100 |
parents | GeoQuiz/Helpers/FormLink.swift@425078c01194 |
children | eb23effeede7 |
comparison
equal
deleted
inserted
replaced
26:425078c01194 | 27:3f4b366d476d |
---|---|
1 // | |
2 // SettingsRow.swift | |
3 // GeoQuiz | |
4 // | |
5 // Created by Dennis Concepción Martín on 7/10/22. | |
6 // | |
7 | |
8 import SwiftUI | |
9 | |
10 struct SettingsRow: View { | |
11 var color: Color | |
12 var symbol: String | |
13 var text: String | |
14 var url: URL | |
15 | |
16 @Environment(\.openURL) var openURL | |
17 | |
18 var body: some View { | |
19 Link(destination: url) { | |
20 HStack(alignment: .center, spacing: 20) { | |
21 RoundedRectangle(cornerRadius: 5) | |
22 .frame(width: 30, height: 30) | |
23 .foregroundColor(color) | |
24 .overlay( | |
25 Image(systemName: symbol) | |
26 .foregroundColor(.white) | |
27 ) | |
28 | |
29 Text(text) | |
30 .foregroundColor(.primary) | |
31 } | |
32 } | |
33 } | |
34 } | |
35 | |
36 struct SettingsRow_Previews: PreviewProvider { | |
37 static var previews: some View { | |
38 SettingsRow( | |
39 color: .mayaBlue, | |
40 symbol: "info", | |
41 text: "About", | |
42 url: URL(string: "https://dennistech.io")! | |
43 ) | |
44 } | |
45 } |