Skip to content

Commit

Permalink
Update shelf to have blurred background
Browse files Browse the repository at this point in the history
  • Loading branch information
mpdifran committed Jun 3, 2024
1 parent a821e3e commit 499283e
Showing 1 changed file with 47 additions and 13 deletions.
60 changes: 47 additions & 13 deletions Sources/AppUI/Extensions/View/View+Shelf.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,16 @@ struct ViewShelf<ShelfContent: View>: ViewModifier {
}

func body(content: Content) -> some View {
VStack(spacing: 0) {
content
shelfContent
.padding()
}
content
.safeAreaInset(edge: .bottom) {
shelfContent
.padding()
.background {
Rectangle()
.fill(.bar)
.edgesIgnoringSafeArea(.bottom)
}
}
}
}

Expand All @@ -32,13 +37,42 @@ public extension View {


#Preview {
List {
Text("1")
Text("2")
Text("3")
Text("4")
}
.shelf {
ProminentButton("Create") { }
NavigationView {
List {
Text("1")
Text("2")
Text("3")
Text("4")
Text("5")
Text("6")
Text("7")
Text("8")
Text("9")
Text("0")
Text("1")
Text("2")
Text("3")
Text("4")
Text("5")
Text("6")
Text("7")
Text("8")
Text("9")
Text("0")
Text("1")
Text("2")
Text("3")
Text("4")
Text("5")
Text("6")
Text("7")
Text("8")
Text("9")
Text("0")
}
.navigationTitle("Preview")
.shelf {
ProminentButton("Create") { }
}
}
}

0 comments on commit 499283e

Please sign in to comment.