mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 08:32:53 +02:00
New App Layout: Added missing empty states in room list and space bottom sheet
This commit is contained in:
+38
-2
@@ -29,6 +29,18 @@ struct SpaceSelector: View {
|
||||
@ObservedObject var viewModel: SpaceSelectorViewModel.Context
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
if !viewModel.viewState.items.isEmpty {
|
||||
itemListView
|
||||
} else {
|
||||
emptyListPlaceholder
|
||||
}
|
||||
}
|
||||
.background(theme.colors.background.edgesIgnoringSafeArea(.all))
|
||||
.accentColor(theme.colors.accent)
|
||||
}
|
||||
|
||||
private var itemListView: some View {
|
||||
ScrollView {
|
||||
LazyVStack {
|
||||
ForEach(viewModel.viewState.items) { item in
|
||||
@@ -50,7 +62,6 @@ struct SpaceSelector: View {
|
||||
}
|
||||
}
|
||||
.frame(maxHeight: .infinity)
|
||||
.background(theme.colors.background.edgesIgnoringSafeArea(.all))
|
||||
.navigationTitle(viewModel.viewState.navigationTitle)
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .confirmationAction) {
|
||||
@@ -66,7 +77,32 @@ struct SpaceSelector: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
.accentColor(theme.colors.accent)
|
||||
}
|
||||
|
||||
private var emptyListPlaceholder: some View {
|
||||
VStack {
|
||||
Spacer()
|
||||
Text(VectorL10n.spaceSelectorEmptyViewTitle)
|
||||
.foregroundColor(theme.colors.primaryContent)
|
||||
.font(theme.fonts.title3SB)
|
||||
.accessibility(identifier: "emptyListPlaceholderTitle")
|
||||
Spacer()
|
||||
.frame(height: 24)
|
||||
Text(VectorL10n.spaceSelectorEmptyViewInformation)
|
||||
.foregroundColor(theme.colors.secondaryContent)
|
||||
.font(theme.fonts.callout)
|
||||
.multilineTextAlignment(.center)
|
||||
.accessibility(identifier: "emptyListPlaceholderMessage")
|
||||
Spacer()
|
||||
Button { viewModel.send(viewAction: .createSpace) } label: {
|
||||
Text(VectorL10n.spaceSelectorCreateSpace)
|
||||
.font(theme.fonts.bodySB)
|
||||
}
|
||||
.buttonStyle(PrimaryActionButtonStyle())
|
||||
.accessibility(identifier: "createSpaceButton")
|
||||
}
|
||||
.padding(.horizontal, 24)
|
||||
.padding(.bottom, 24)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user