-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
struct SignInButton: View { | ||
@Environment(\.colorScheme) private var colorScheme | ||
let action: () -> Void | ||
let isDisabled: Bool | ||
|
||
init(action: @escaping () -> Void, isDisabled: Bool = false) { | ||
self.action = action | ||
self.isDisabled = isDisabled | ||
} | ||
|
||
var body: some View { | ||
Button(action: action) { | ||
Label("Sign In", systemImage: "iphone.and.arrow.forward.inward") | ||
.font(.system(size: 20)) | ||
.frame(maxWidth: .infinity) | ||
.frame(height: 44) | ||
} | ||
.buttonStyle(.bordered) | ||
.foregroundStyle(colorScheme == .dark ? Color.yellow : Color.black) | ||
.overlay { | ||
if colorScheme == .dark { | ||
RoundedRectangle(cornerRadius: 4) | ||
.stroke(Color.yellow, lineWidth: 4) | ||
} else { | ||
RoundedRectangle(cornerRadius: 4) | ||
.stroke(.clear) | ||
} | ||
} | ||
// .cornerRadius(4) | ||
.disabled(isDisabled) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters