-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from WalletConnect/1click-auth
siwe fallback
- Loading branch information
Showing
14 changed files
with
305 additions
and
46 deletions.
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
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
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
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,35 @@ | ||
import Foundation | ||
import SwiftMessages | ||
import UIKit | ||
|
||
struct AlertPresenter { | ||
enum MessageType { | ||
case warning | ||
case error | ||
case info | ||
case success | ||
} | ||
|
||
static func present(message: String, type: AlertPresenter.MessageType) { | ||
DispatchQueue.main.async { | ||
let view = MessageView.viewFromNib(layout: .cardView) | ||
switch type { | ||
case .warning: | ||
view.configureTheme(.warning, iconStyle: .subtle) | ||
case .error: | ||
view.configureTheme(.error, iconStyle: .subtle) | ||
case .info: | ||
view.configureTheme(.info, iconStyle: .subtle) | ||
case .success: | ||
view.configureTheme(.success, iconStyle: .subtle) | ||
} | ||
view.button?.isHidden = true | ||
view.layoutMarginAdditions = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20) | ||
view.configureContent(title: "", body: message) | ||
var config = SwiftMessages.Config() | ||
config.presentationStyle = .top | ||
config.duration = .seconds(seconds: 1.5) | ||
SwiftMessages.show(config: config, view: view) | ||
} | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.