mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 19:44:05 +00:00
Some more tweaks to compound for User Status. (#5708)
* Add a plain list modifier to Compound. * Move ElementTextFieldStyle into Compound and support more styles from the Figma - More accurately reflects our Liquid Glass updates. - Adds support for the .raised style. * Update Element X snapshots.
This commit is contained in:
@@ -8,12 +8,28 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
public enum CompoundListKind {
|
||||
/// The default style for `List` or `Form`.
|
||||
case inset
|
||||
/// The `.plain` style when using a `List`.
|
||||
case plain
|
||||
}
|
||||
|
||||
public extension View {
|
||||
/// Styles a list using the Compound design tokens.
|
||||
func compoundList() -> some View {
|
||||
environment(\.defaultMinListRowHeight, 48)
|
||||
.scrollContentBackground(.hidden)
|
||||
.background(Color.compound.bgSubtleSecondaryLevel0.ignoresSafeArea())
|
||||
@ViewBuilder
|
||||
func compoundList(_ kind: CompoundListKind = .inset) -> some View {
|
||||
switch kind {
|
||||
case .inset:
|
||||
environment(\.defaultMinListRowHeight, 48)
|
||||
.scrollContentBackground(.hidden)
|
||||
.background(Color.compound.bgSubtleSecondaryLevel0.ignoresSafeArea())
|
||||
case .plain:
|
||||
listStyle(.plain)
|
||||
.environment(\.defaultMinListRowHeight, 48)
|
||||
.scrollContentBackground(.hidden)
|
||||
.background(Color.compound.bgCanvasDefault.ignoresSafeArea())
|
||||
}
|
||||
}
|
||||
|
||||
/// Styles a list section header using the Compound design tokens.
|
||||
|
||||
Reference in New Issue
Block a user