diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index a80be93d1..b81eae062 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -1648,3 +1648,11 @@ Tap the + to start adding people."; "user_avatar_view_accessibility_label" = "avatar"; "user_avatar_view_accessibility_hint" = "Change user avatar"; + +// Mark: - Side menu + +"side_menu_action_invite_friends" = "Invite friends"; +"side_menu_action_settings" = "Settings"; +"side_menu_action_help" = "Help"; +"side_menu_action_feedback" = "Feedback"; +"side_menu_app_version" = "Version %@"; diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index 2fff0ea2c..6444878cb 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -4486,6 +4486,26 @@ internal enum VectorL10n { internal static var shareExtensionFailedToEncrypt: String { return VectorL10n.tr("Vector", "share_extension_failed_to_encrypt") } + /// Feedback + internal static var sideMenuActionFeedback: String { + return VectorL10n.tr("Vector", "side_menu_action_feedback") + } + /// Help + internal static var sideMenuActionHelp: String { + return VectorL10n.tr("Vector", "side_menu_action_help") + } + /// Invite friends + internal static var sideMenuActionInviteFriends: String { + return VectorL10n.tr("Vector", "side_menu_action_invite_friends") + } + /// Settings + internal static var sideMenuActionSettings: String { + return VectorL10n.tr("Vector", "side_menu_action_settings") + } + /// Version %@ + internal static func sideMenuAppVersion(_ p1: String) -> String { + return VectorL10n.tr("Vector", "side_menu_app_version", p1) + } /// Sign out internal static var signOutExistingKeyBackupAlertSignOutAction: String { return VectorL10n.tr("Vector", "sign_out_existing_key_backup_alert_sign_out_action") diff --git a/Riot/Modules/SideMenu/SideMenuItem.swift b/Riot/Modules/SideMenu/SideMenuItem.swift new file mode 100644 index 000000000..9d522dec1 --- /dev/null +++ b/Riot/Modules/SideMenu/SideMenuItem.swift @@ -0,0 +1,62 @@ +// +// Copyright 2021 New Vector Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import Foundation + +/// SideMenuItem represents side menu actions +enum SideMenuItem { + case inviteFriends + case settings + case help + case feedback +} + +extension SideMenuItem { + + var title: String { + let title: String + + switch self { + case .inviteFriends: + title = VectorL10n.sideMenuActionInviteFriends + case .settings: + title = VectorL10n.sideMenuActionSettings + case .help: + title = VectorL10n.sideMenuActionHelp + case .feedback: + title = VectorL10n.sideMenuActionFeedback + } + + return title + } + + var icon: UIImage { + let icon: UIImage + + switch self { + case .inviteFriends: + icon = Asset.Images.sideMenuActionIconShare.image + case .settings: + icon = Asset.Images.sideMenuActionIconSettings.image + case .help: + icon = Asset.Images.sideMenuActionIconHelp.image + case .feedback: + icon = Asset.Images.sideMenuActionIconFeedback.image + } + + return icon + } +}