Float the dashboard rail along the bottom on a phone
Below md a dashboard stacks to one column and dropped its rail. The rail is
now a horizontal row in the dashboard's own look, floated over the bottom
of the screen on /panel/{id} and above the dock in the app's view, with
44px items, sideways scrolling when it overflows, and padding so the last
tile clears it; a panel's read-only notice moves up out of its way. The
three looks share the geometry from ui/core.
This commit is contained in:
@@ -15,6 +15,7 @@ import { useUi } from "./ui"
|
||||
*
|
||||
* Drawn in the dashboard's own look, because it hangs on the same screen: a
|
||||
* rail wearing the app's chrome beside a glass panel is two designs at once.
|
||||
* On a phone it is a row the caller floats along the bottom.
|
||||
*
|
||||
* Reading the dashboards it links to is also what fills the labels, and it
|
||||
* warms the cache for the neighbours so a switch draws immediately.
|
||||
@@ -23,10 +24,12 @@ export function PanelRail({
|
||||
dashboards,
|
||||
current,
|
||||
linkFor,
|
||||
horizontal,
|
||||
}: {
|
||||
dashboards: string[]
|
||||
current: string
|
||||
linkFor: (name: string) => LinkProps
|
||||
horizontal?: boolean
|
||||
}) {
|
||||
const { Rail } = useUi()
|
||||
const entries = useQueries({
|
||||
@@ -41,5 +44,5 @@ export function PanelRail({
|
||||
})),
|
||||
})
|
||||
|
||||
return <Rail entries={entries} />
|
||||
return <Rail entries={entries} horizontal={horizontal} />
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user