Skip to content
Snippets Groups Projects
Commit ec1d7963 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk
Browse files

smartList: add donation option to menu

Change-Id: Ib7f5fc7259f0dbae56277d252ff33f0296038123
parent cc177a6c
No related branches found
No related tags found
No related merge requests found
...@@ -88,6 +88,7 @@ extension UIColor { ...@@ -88,6 +88,7 @@ extension UIColor {
} }
static let jamiMain = UIColor(red: 0, green: 86, blue: 153, alpha: 1.0) static let jamiMain = UIColor(red: 0, green: 86, blue: 153, alpha: 1.0)
static let jamiDonation = UIColor(red: 255, green: 0, blue: 69, alpha: 1.0)
static let conferenceRaiseHand = UIColor(red: 0, green: 184, blue: 255, alpha: 1.0) static let conferenceRaiseHand = UIColor(red: 0, green: 184, blue: 255, alpha: 1.0)
static let jamiSecondary = UIColor(hex: 0x1F4971, alpha: 1.0) static let jamiSecondary = UIColor(hex: 0x1F4971, alpha: 1.0)
static let jamiButtonLight = UIColor(named: "jamiButtonLight")! static let jamiButtonLight = UIColor(named: "jamiButtonLight")!
......
...@@ -704,7 +704,7 @@ extension SmartlistViewController: CNContactPickerDelegate { ...@@ -704,7 +704,7 @@ extension SmartlistViewController: CNContactPickerDelegate {
// MARK: - menu // MARK: - menu
extension SmartlistViewController { extension SmartlistViewController {
private func createMenu() -> UIMenu { private func createMenu() -> UIMenu {
return UIMenu(title: "", children: [createSwarmAction(), inviteFriendsAction(), accountsAction(), openAccountAction(), openSettingsAction(), aboutJamiAction()]) return UIMenu(title: "", children: [createSwarmAction(), inviteFriendsAction(), accountsAction(), openAccountAction(), openSettingsAction(), donateAction(), aboutJamiAction()])
} }
private func createTintedImage(systemName: String, configuration: UIImage.SymbolConfiguration, tintColor: UIColor) -> UIImage? { private func createTintedImage(systemName: String, configuration: UIImage.SymbolConfiguration, tintColor: UIColor) -> UIImage? {
...@@ -732,6 +732,13 @@ extension SmartlistViewController { ...@@ -732,6 +732,13 @@ extension SmartlistViewController {
} }
} }
private func donateAction() -> UIAction {
let image = createTintedImage(systemName: "heart", configuration: configuration, tintColor: .jamiDonation)
return UIAction(title: L10n.Global.donate, image: image, identifier: nil, discoverabilityTitle: nil, attributes: [], state: .off) { _ in
SharedActionsPresenter.openDonationLink()
}
}
private func accountsAction() -> UIAction { private func accountsAction() -> UIAction {
let image = createTintedImage(systemName: "list.bullet", configuration: configuration, tintColor: .jamiButtonDark) let image = createTintedImage(systemName: "list.bullet", configuration: configuration, tintColor: .jamiButtonDark)
return UIAction(title: L10n.Smartlist.accounts, image: image, identifier: nil, discoverabilityTitle: nil, attributes: [], state: .off) { [weak self] _ in return UIAction(title: L10n.Smartlist.accounts, image: image, identifier: nil, discoverabilityTitle: nil, attributes: [], state: .off) { [weak self] _ in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment