mirror of
https://github.com/twofas/2fas-ios.git
synced 2024-11-25 19:59:58 +01:00
[TF-1576] fix
This commit is contained in:
parent
9e5cab719f
commit
f1cfdf63ad
@ -26,7 +26,7 @@ enum MainContainerBottomNavigationGenerator {
|
||||
case normal
|
||||
case template(color: UIColor)
|
||||
}
|
||||
case filledButton(text: String, callback: Callback, created: ((LoadingContentButton) -> Void)? = nil)
|
||||
case filledButton(text: String, isEnabled: Bool = true, callback: Callback, created: ((LoadingContentButton) -> Void)? = nil)
|
||||
case textButton(text: String, callback: Callback, created: ((LoadingContentButton) -> Void)? = nil)
|
||||
case text(text: String, style: MainContainerTextStyling, created: ((UILabel) -> Void)? = nil)
|
||||
case pagination(currentPage: Int, totalPages: Int)
|
||||
@ -52,10 +52,11 @@ enum MainContainerBottomNavigationGenerator {
|
||||
|
||||
private static func elementToView(_ element: Element) -> UIView {
|
||||
switch element {
|
||||
case .filledButton(let text, let callback, let created):
|
||||
case .filledButton(let text, let isEnabled, let callback, let created):
|
||||
let button = LoadingContentButton()
|
||||
button.configure(style: .background, title: text)
|
||||
button.action = callback
|
||||
button.setState(isEnabled ? .active : .inactive)
|
||||
created?(button)
|
||||
return button
|
||||
|
||||
|
@ -74,7 +74,7 @@ final class ImporterPreimportSummaryViewController: UIViewController {
|
||||
])
|
||||
|
||||
let contentBottom = MainContainerBottomContentGenerator(elements: [
|
||||
.filledButton(text: T.Backup.importFile, callback: { [weak self] in self?.presenter.handleImport() }),
|
||||
.filledButton(text: T.Backup.importFile, isEnabled: presenter.countNew > 0, callback: { [weak self] in self?.presenter.handleImport() }),
|
||||
.textButton(
|
||||
text: T.Commons.cancel,
|
||||
callback: { [weak self] in self?.presenter.handleCancel() },
|
||||
|
Loading…
Reference in New Issue
Block a user