PWD-1: refactor button component
This commit is contained in:
parent
63d2c9e6eb
commit
ca240988b8
1 changed files with 11 additions and 13 deletions
|
@ -17,21 +17,19 @@ struct PwdButton<Label: View>: View {
|
|||
var action: () -> Void
|
||||
|
||||
var body: some View {
|
||||
HStack {
|
||||
Button(action: action) {
|
||||
label
|
||||
}
|
||||
.padding(size.padding)
|
||||
.background(variant.backgroundColor(colorScheme))
|
||||
.foregroundColor(variant.foregroundColor(colorScheme))
|
||||
.font(size.font)
|
||||
.cornerRadius(size.cornerRadius)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: size.cornerRadius)
|
||||
.stroke(variant.borderColor(colorScheme), lineWidth: variant.borderWidth)
|
||||
)
|
||||
.onTapGesture {
|
||||
action()
|
||||
}
|
||||
.buttonStyle(PlainButtonStyle())
|
||||
.padding(size.padding)
|
||||
.background(variant.backgroundColor(colorScheme))
|
||||
.foregroundColor(variant.foregroundColor(colorScheme))
|
||||
.font(size.font)
|
||||
.cornerRadius(size.cornerRadius)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: size.cornerRadius)
|
||||
.stroke(variant.borderColor(colorScheme), lineWidth: variant.borderWidth)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue