Create room redesign and refactor (#4942)

This commit is contained in:
Mauro
2026-01-12 18:49:31 +01:00
committed by GitHub
parent f42c063e50
commit 4cfedefcca
77 changed files with 463 additions and 348 deletions
@@ -23,12 +23,13 @@ enum CreateRoomScreenViewModelAction {
}
struct CreateRoomScreenViewState: BindableState {
let isSpace: Bool
var roomName: String
let serverName: String
let isKnockingFeatureEnabled: Bool
var aliasLocalPart: String
var bindings: CreateRoomScreenViewStateBindings
var avatarURL: URL?
var avatarMediaInfo: MediaInfo?
var canCreateRoom: Bool {
!roomName.isEmpty && aliasErrors.isEmpty
}
@@ -43,12 +44,19 @@ struct CreateRoomScreenViewState: BindableState {
nil
}
}
var availableAccessTypes: [CreateRoomAccessType] {
var availableTypes = CreateRoomAccessType.allCases
if !isKnockingFeatureEnabled {
availableTypes.removeAll { $0 == .askToJoin }
}
return availableTypes
}
}
struct CreateRoomScreenViewStateBindings {
var roomTopic: String
var isRoomPrivate: Bool
var isKnockingOnly: Bool
var selectedAccessType: CreateRoomAccessType
var showAttachmentConfirmationDialog = false
/// Information describing the currently displayed alert.