Mercurial > public > geoquiz
view GeoQuiz/Components/AnswerButtonHelper.swift @ 17:8dac58bb4569
fix build bug
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Thu, 20 Oct 2022 18:07:51 +0200 |
parents | a793f33f05fb |
children | f140bb277c96 |
line wrap: on
line source
// // AnswerButtonHelper.swift // GeoQuiz // // Created by Dennis Concepción Martín on 14/9/22. // import SwiftUI struct AnswerButton: View { let optionName: String let color: Color var body: some View { RoundedRectangle(cornerRadius: 15) .foregroundColor(.white) .overlay( Text(optionName) .font(.title2.bold()) .foregroundColor(color) ) } } struct AnswerButton_Previews: PreviewProvider { static var previews: some View { ZStack { LinearGradient(gradient: .main, startPoint: .top, endPoint: .bottom) .ignoresSafeArea() VStack { Spacer() AnswerButton(optionName: "Madrid", color: .royalLightBlue) .frame(height: 70) } .padding() } } }