9
|
1 //
|
27
|
2 // SettingsRow.swift
|
9
|
3 // GeoQuiz
|
|
4 //
|
|
5 // Created by Dennis Concepción Martín on 7/10/22.
|
|
6 //
|
|
7
|
|
8 import SwiftUI
|
|
9
|
27
|
10 struct SettingsRow: View {
|
9
|
11 var color: Color
|
19
|
12 var symbol: String
|
9
|
13 var text: String
|
|
14
|
|
15
|
|
16 var body: some View {
|
30
|
17 HStack(alignment: .center, spacing: 20) {
|
|
18 RoundedRectangle(cornerRadius: 5)
|
|
19 .frame(width: 30, height: 30)
|
|
20 .foregroundColor(color)
|
|
21 .overlay(
|
|
22 Image(systemName: symbol)
|
|
23 .foregroundColor(.white)
|
|
24 )
|
|
25
|
|
26 Text(text)
|
|
27 .foregroundColor(.primary)
|
9
|
28 }
|
30
|
29
|
9
|
30 }
|
|
31 }
|
|
32
|
27
|
33 struct SettingsRow_Previews: PreviewProvider {
|
9
|
34 static var previews: some View {
|
27
|
35 SettingsRow(
|
9
|
36 color: .mayaBlue,
|
27
|
37 symbol: "info",
|
30
|
38 text: "About"
|
9
|
39 )
|
|
40 }
|
|
41 }
|