mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 15:45:11 +00:00
Update the toolbars in the Chats/Spaces screens. (#6043)
* Fix an issue with macro compilation when using Xcode previews. * Update the Chats/Spaces toolbars to match the Figma. Fixes a bug with the status emoji in the liquid glass button.
This commit is contained in:
@@ -17,6 +17,7 @@ struct SpacesScreen: View {
|
||||
.navigationTitle(L10n.screenSpaceListTitle)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar { toolbar }
|
||||
.toolbarRole(Compound.supportsGlass ? .editor : .automatic)
|
||||
.background(Color.compound.bgCanvasDefault.ignoresSafeArea())
|
||||
.toolbarBloom(hasSearchBar: false)
|
||||
}
|
||||
@@ -54,7 +55,7 @@ struct SpacesScreen: View {
|
||||
|
||||
VStack(spacing: 8) {
|
||||
Text(L10n.screenSpaceListTitle)
|
||||
.font(.compound.headingLGBold)
|
||||
.font(.compound.headingMDBold)
|
||||
.foregroundStyle(.compound.textPrimary)
|
||||
.multilineTextAlignment(.center)
|
||||
|
||||
@@ -92,7 +93,8 @@ struct SpacesScreen: View {
|
||||
|
||||
@ToolbarContentBuilder
|
||||
private var toolbar: some ToolbarContent {
|
||||
ToolbarItem(placement: .navigationBarLeading) {
|
||||
// Use the title placement on iOS 26 to match the chats tab and fix a weird animation.
|
||||
ToolbarItem(placement: Compound.supportsGlass ? .title : .navigationBarLeading) {
|
||||
Button {
|
||||
context.send(viewAction: .showSettings)
|
||||
} label: {
|
||||
@@ -103,14 +105,18 @@ struct SpacesScreen: View {
|
||||
.accessibilityLabel(L10n.commonSettings)
|
||||
.accessibilityIdentifier(A11yIdentifiers.homeScreen.userAvatar)
|
||||
}
|
||||
|
||||
ToolbarItem(placement: .principal) {
|
||||
// Hides the navigationTitle (which is set for the navigation stack label).
|
||||
Text("").accessibilityHidden(true)
|
||||
}
|
||||
.backportSharedBackgroundVisibility(.hidden)
|
||||
|
||||
ToolbarItem(placement: .navigationBarTrailing) {
|
||||
// No need to hide the title on iOS 26, as we use the .title placement for the settings
|
||||
// button to workaround a weird liquid glass transition.
|
||||
if #unavailable(iOS 26) {
|
||||
ToolbarItem(placement: .principal) {
|
||||
// Hides the navigationTitle (which is set for the navigation stack label).
|
||||
Text("").accessibilityHidden(true)
|
||||
}
|
||||
}
|
||||
|
||||
ToolbarItem(placement: .primaryAction) {
|
||||
Button {
|
||||
context.send(viewAction: .createSpace)
|
||||
} label: {
|
||||
|
||||
Reference in New Issue
Block a user