mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Add the UI for your own user status in the Settings screen. (#5888)
* Show the user's own Status emoji on the SettingsScreen. * Add the UI for setting your own status. * Add placeholder action for selecting a custom emoji and fix some accessibility issues.
This commit is contained in:
@@ -35,6 +35,7 @@ enum SettingsScreenSecuritySectionMode {
|
||||
struct SettingsScreenViewState: BindableState {
|
||||
var deviceID: String?
|
||||
var userProfile: UserProfile
|
||||
var showUserStatus: Bool
|
||||
var showLinkNewDeviceButton: Bool
|
||||
var accountProfileURL: URL?
|
||||
var showAccountDeactivation: Bool
|
||||
@@ -51,15 +52,28 @@ struct SettingsScreenViewState: BindableState {
|
||||
let navigationBarVisibility: Visibility
|
||||
|
||||
var bindings = SettingsScreenViewStateBindings()
|
||||
|
||||
var userStatusRowMode: SettingsScreenUserStatusRow.Mode {
|
||||
if bindings.isShowingCustomStatusField {
|
||||
.custom
|
||||
} else if let rawStatus = userProfile.status.raw {
|
||||
.show(rawStatus)
|
||||
} else {
|
||||
.pick
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct SettingsScreenViewStateBindings {
|
||||
var isPresentingStatusPicker = false
|
||||
var isShowingCustomStatusField = false
|
||||
var isPresentingAccountDeactivationConfirmation = false
|
||||
}
|
||||
|
||||
enum SettingsScreenViewAction {
|
||||
case close
|
||||
case userDetails
|
||||
case userStatus(UserStatusAction)
|
||||
case analytics
|
||||
case appLock
|
||||
case reportBug
|
||||
@@ -75,4 +89,17 @@ enum SettingsScreenViewAction {
|
||||
case labs
|
||||
case logout
|
||||
case deactivateAccount
|
||||
|
||||
enum UserStatusAction {
|
||||
/// Show status picker sheet to select a preset status.
|
||||
case pickStatus
|
||||
/// Dismiss the picker sheet and show the custom status input.
|
||||
case customStatus
|
||||
/// Show the emoji picker to select the emoji for the custom status.
|
||||
case pickCustomEmoji
|
||||
/// Set the user's status to the provided value.
|
||||
case set(UserStatus.Raw?)
|
||||
/// Cancel user status picking/input.
|
||||
case cancel
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user