Skip to content

Commit

Permalink
UI updates
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnEstropia committed Dec 5, 2024
1 parent 235503b commit eb17f47
Showing 1 changed file with 23 additions and 18 deletions.
41 changes: 23 additions & 18 deletions Sources/StorybookKit/Primitives/Book.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,31 @@ public struct Book: BookView, Identifiable {
0,
title: .init(fileID[module.endIndex...]),
destination: { [registries = registriesByFileID[fileID]!] in
ScrollView {
LazyVStack(
alignment: .center,
spacing: 16,
pinnedViews: .sectionHeaders
) {
Section(
content: {
ForEach.inefficient(items: registries) { registry in
AnyView(registry.makeView())
}
},
header: {
Text(fileID)
.truncationMode(.head)
.font(.caption.monospacedDigit())
LazyVStack(
alignment: .center,
spacing: 16,
pinnedViews: .sectionHeaders
) {
Section(
content: {
ForEach.inefficient(items: registries) { registry in
AnyView(registry.makeView())
}
)
}
},
header: {
Text(fileID)
.multilineTextAlignment(.leading)
.truncationMode(.head)
.foregroundStyle(.secondary)
.font(.caption.monospacedDigit())
.padding(.horizontal, 16)
.padding(.vertical, 8)
.frame(maxWidth: .infinity)
.background(.thickMaterial)
}
)
}
.edgesIgnoringSafeArea(.top)
}
)
)
Expand Down

0 comments on commit eb17f47

Please sign in to comment.