PWD-1: refactor button component

This commit is contained in:
Markus Thielker 2025-01-21 16:03:29 +01:00
parent 63d2c9e6eb
commit ca240988b8
No known key found for this signature in database

View file

@ -17,9 +17,10 @@ struct PwdButton<Label: View>: View {
var action: () -> Void var action: () -> Void
var body: some View { var body: some View {
HStack { Button(action: action) {
label label
} }
.buttonStyle(PlainButtonStyle())
.padding(size.padding) .padding(size.padding)
.background(variant.backgroundColor(colorScheme)) .background(variant.backgroundColor(colorScheme))
.foregroundColor(variant.foregroundColor(colorScheme)) .foregroundColor(variant.foregroundColor(colorScheme))
@ -29,9 +30,6 @@ struct PwdButton<Label: View>: View {
RoundedRectangle(cornerRadius: size.cornerRadius) RoundedRectangle(cornerRadius: size.cornerRadius)
.stroke(variant.borderColor(colorScheme), lineWidth: variant.borderWidth) .stroke(variant.borderColor(colorScheme), lineWidth: variant.borderWidth)
) )
.onTapGesture {
action()
}
} }
} }