feat(layout): add page tabs and a header page title - #51
Conversation
{
path: '/test',
label: 'Test',
tabs: [
{
label: 'Test Page',
element: <TestPage />,
path: '/testing', //this one breaks
},
{
label: 'Docs',
element: <Documentation />,
path: 'docs', //this one works fine
}
],
icon: <TestTube size={32} />,
isBackgroundTransparent: true,
}, |
| return ( | ||
| <nav | ||
| className={cn( | ||
| 'flex gap-1 px-7 h-[52px] items-stretch shrink-0 bg-black/[0.14] border-b border-white/10', |
There was a problem hiding this comment.
Please use rems for the h-[52px] here since this contains text, h-[##rem]. Similar comment for the padding
There was a problem hiding this comment.
Whoops, I was hoping to be as close to the mockup as possible, hence the hardcoded pixels. Thanks for pointing this out, used rems as much as possible. There's a slight difference now though, hopefully it is still acceptable.
Before:
After:
FYI @alisonscheng
|
Something that I should have done earlier, but can we please create a |
26b33ce to
8b894eb
Compare
Nice catch, I made the route normalization a bit more robust in 14edc00
Sure, added in 0783e1c |
SeijDeLeon
left a comment
There was a problem hiding this comment.
Thanks for making these changes and adding this, look good
A route can now split its page into tabs instead of rendering a single element and show the page title.
Each tab gets its own URL, so it can be linked, bookmarked, and restored after a refresh. Visiting the base route redirects to the first tab.
chrome_Sq40ZU8vrp.mp4
The header now shows the current page after the app title. For the root route (`/`), the page title is hidden by default.
The route now looks like as follows: