Mercurial > public > geoquiz
comparison GeoQuiz/Helpers/AnswerButton.swift @ 0:413e2d21333e
first commit
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Tue, 20 Sep 2022 08:13:26 +0200 |
parents | |
children | 1946bbfde4af |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:413e2d21333e |
---|---|
1 // | |
2 // AnswerButton.swift | |
3 // GeoQuiz | |
4 // | |
5 // Created by Dennis Concepción Martín on 14/9/22. | |
6 // | |
7 | |
8 import SwiftUI | |
9 | |
10 struct AnswerButton: View { | |
11 let optionName: String | |
12 let color: Color | |
13 | |
14 var body: some View { | |
15 RoundedRectangle(cornerRadius: 15) | |
16 .foregroundStyle(.regularMaterial) | |
17 .overlay( | |
18 Text(optionName) | |
19 .font(.title2.bold()) | |
20 .foregroundColor(color) | |
21 ) | |
22 } | |
23 } | |
24 | |
25 struct AnswerButton_Previews: PreviewProvider { | |
26 static var previews: some View { | |
27 ZStack { | |
28 LinearGradient(gradient: .main, startPoint: .top, endPoint: .bottom) | |
29 .ignoresSafeArea() | |
30 | |
31 VStack { | |
32 Spacer() | |
33 AnswerButton(optionName: "Madrid", color: .royalLightBlue) | |
34 .frame(height: 70) | |
35 } | |
36 .padding() | |
37 } | |
38 } | |
39 } |