Hook up the emoji picker to the custom status row. (#5902)

* Refactor EmojiPickerScreen to take a continuation instead of a timeline/itemID.

* Hook up the emoji picker to the custom status row.
This commit is contained in:
Doug
2026-07-22 13:35:37 +01:00
committed by GitHub
parent a6466e80e0
commit 32a54c5b71
19 changed files with 223 additions and 92 deletions
@@ -8,9 +8,10 @@
import SwiftUI
enum SettingsScreenViewModelAction: Equatable {
enum SettingsScreenViewModelAction {
case close
case userDetails
case userStatusEmojiPicker(EmojiPickerScreenContinuation)
case linkNewDevice
case manageAccount(url: URL)
case analytics
@@ -55,7 +56,7 @@ struct SettingsScreenViewState: BindableState {
var userStatusRowMode: SettingsScreenUserStatusRow.Mode {
if bindings.isShowingCustomStatusField {
.custom
.custom(emoji: bindings.customStatusEmoji)
} else if let rawStatus = userProfile.status.raw {
.show(rawStatus)
} else {
@@ -66,7 +67,15 @@ struct SettingsScreenViewState: BindableState {
struct SettingsScreenViewStateBindings {
var isPresentingStatusPicker = false
var isShowingCustomStatusField = false
var customStatusEmoji: Character = "😄"
var isShowingCustomStatusField = false {
didSet {
if !isShowingCustomStatusField {
customStatusEmoji = "😄" // Reset the emoji.
}
}
}
var isPresentingAccountDeactivationConfirmation = false
}