-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feature - more menu configuration * feature - more menu configuration * feature - o11y removal * chore - API key
- Loading branch information
1 parent
b3acab1
commit fb6b551
Showing
12 changed files
with
119 additions
and
38 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,65 @@ | ||
import Foundation | ||
import RetailMoreJourney | ||
import Resolver | ||
import BackbaseDesignSystem | ||
import IdentityAuthenticationJourney | ||
|
||
struct MoreMenuConfiguration { | ||
|
||
private static var demoSection: More.MenuSection { | ||
let securityItems: [More.MenuItem] = [ | ||
.init( | ||
title: .init(key: "retailUniversalApp.more.items.demo", in: .app), | ||
icon: UIImage(systemName: "d.square"), | ||
iconBackgroundColor: DesignSystem.shared.colors.primary.default, | ||
iconTintColor: DesignSystem.shared.colors.primary.onDefault, | ||
action: { navigationController in | ||
navigationController.pushViewController(DemoViewController(title: "Demo"), animated: true) | ||
} | ||
) | ||
] | ||
return .init(title: nil, items: securityItems) | ||
} | ||
|
||
private static var securitySection: More.MenuSection { | ||
let securityItems: [More.MenuItem] = [ | ||
.init( | ||
title: .init(key: "retailUniversalApp.more.items.logout", in: .app), | ||
icon: UIImage(systemName: "iphone.and.arrow.forward"), | ||
iconBackgroundColor: DesignSystem.shared.colors.danger.default, | ||
iconTintColor: DesignSystem.shared.colors.primary.onDefault, | ||
action: { _ in | ||
let useCase: AuthenticationUseCase = Resolver.resolve() | ||
useCase.endSession(callback: nil) | ||
} | ||
) | ||
] | ||
return .init(title: nil, items: securityItems) | ||
} | ||
|
||
static func setupMoreMenu() { | ||
Resolver.register { appDefault } | ||
} | ||
|
||
static var appDefault: More.Configuration { | ||
let menu = More.Menu(deferredSections: [demoSection, securitySection]) | ||
var configuration = More.Configuration() | ||
configuration.analytics.journeyName = "more_menu" | ||
configuration.analytics.screenLabel = "more_menu" | ||
configuration.menu = menu | ||
configuration.design.shouldAlwaysBounceVertically = true | ||
return configuration | ||
} | ||
} | ||
|
||
// This is needed by the More Menu configuration | ||
private extension Bundle { | ||
static var app: Bundle? { | ||
let podBundle = Bundle(for: BundleToken.self) | ||
guard let resourceUrl = podBundle.url(forResource: "Assets", withExtension: "bundle") else { return podBundle } | ||
guard let resourceBundle = Bundle(url: resourceUrl) else { return podBundle } | ||
return resourceBundle | ||
} | ||
} | ||
|
||
private final class BundleToken { } |
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 was deleted.
Oops, something went wrong.
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
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