mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Move BigIcon into Compound and add a new TitleAndIcon component. (#4866)
* Move BigIcon into Compound. * Replace the old server selection image asset with the \.host icon. * Add a new TitleAndIcon component to Compound. * Add the ability to override TitleAndIcon's padding.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// Copyright 2025 New Vector Ltd
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
// Please see LICENSE in the repository root for full details.
|
||||
//
|
||||
|
||||
import Compound
|
||||
import SwiftUI
|
||||
|
||||
struct BigIconScreen: View {
|
||||
var body: some View {
|
||||
ScreenContent(navigationTitle: "Big Icon") {
|
||||
BigIcon_Previews.states
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct BigIconScreen_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
NavigationStack {
|
||||
BigIconScreen()
|
||||
}
|
||||
.previewLayout(.fixed(width: 375, height: 700))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// Copyright 2025 New Vector Ltd
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
// Please see LICENSE in the repository root for full details.
|
||||
//
|
||||
|
||||
import Compound
|
||||
import SwiftUI
|
||||
|
||||
struct TitleAndIconScreen: View {
|
||||
var body: some View {
|
||||
ScreenContent(navigationTitle: "Title & Icon") {
|
||||
TitleAndIcon_Previews.states
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct TitleAndIconScreen_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
NavigationStack {
|
||||
TitleAndIconScreen()
|
||||
}
|
||||
.previewLayout(.fixed(width: 375, height: 700))
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,8 @@ enum Screen: Hashable, View {
|
||||
case buttons
|
||||
/// Text field styles.
|
||||
case textFields
|
||||
/// The `BigIcon` component.
|
||||
case bigIcon
|
||||
|
||||
/// The system's confirmation dialog component
|
||||
case actionSheet
|
||||
@@ -53,6 +55,7 @@ enum Screen: Hashable, View {
|
||||
case .labels: EmptyView()
|
||||
case .buttons: ButtonsScreen()
|
||||
case .textFields: EmptyView()
|
||||
case .bigIcon: BigIconScreen()
|
||||
|
||||
case .actionSheet: ActionSheetScreen()
|
||||
case .alert: AlertScreen()
|
||||
|
||||
@@ -45,6 +45,12 @@ struct SidebarList: View {
|
||||
NavigationLink(value: Screen.list) {
|
||||
Label("List", systemImage: "list.bullet.clipboard")
|
||||
}
|
||||
NavigationLink(value: Screen.bigIcon) {
|
||||
Label("Big Icon", systemImage: "square.dashed")
|
||||
}
|
||||
NavigationLink(value: Screen.bigIcon) {
|
||||
Label("Title & Icon", systemImage: "richtext.page")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user