[core][xs]: fix Navbar title not showing
This commit is contained in:
5
.changeset/cuddly-pears-burn.md
Normal file
5
.changeset/cuddly-pears-burn.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@portaljs/core': patch
|
||||
---
|
||||
|
||||
Fix Navbar version not showing.
|
||||
@@ -96,6 +96,7 @@ export const Layout: React.FC<Props> = ({
|
||||
social={nav.social}
|
||||
defaultTheme={theme.defaultTheme}
|
||||
themeToggleIcon={theme.themeToggleIcon}
|
||||
version={nav.version}
|
||||
>
|
||||
{showSidebar && <SiteToc currentPath={urlPath} nav={siteMap} />}
|
||||
</Nav>
|
||||
|
||||
27
packages/core/src/ui/Nav/Nav.stories.tsx
Normal file
27
packages/core/src/ui/Nav/Nav.stories.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react';
|
||||
|
||||
import { NavTitle } from './NavTitle';
|
||||
|
||||
const meta: Meta<typeof NavTitle> = {
|
||||
component: NavTitle,
|
||||
tags: ['autodocs'],
|
||||
};
|
||||
|
||||
export default meta;
|
||||
|
||||
type Story = StoryObj<typeof NavTitle>;
|
||||
|
||||
export const Basic: Story = {
|
||||
args: {
|
||||
title: 'Title',
|
||||
logo: 'https://via.placeholder.com/50',
|
||||
},
|
||||
};
|
||||
|
||||
export const WithVersion: Story = {
|
||||
args: {
|
||||
title: 'Title',
|
||||
logo: 'https://via.placeholder.com/50',
|
||||
version: 'Alpha',
|
||||
},
|
||||
};
|
||||
@@ -18,9 +18,9 @@ export const NavTitle: React.FC<Props> = ({ title, logo, version }) => {
|
||||
)}
|
||||
{title && <span>{title}</span>}
|
||||
{version && (
|
||||
<div className="mx-2 rounded-full border border-slate-500 py-1 px-3 text-xs text-slate-500">
|
||||
<span className="inline-flex items-center rounded-full bg-gray-50 ml-2 px-2 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10">
|
||||
{version}
|
||||
</div>
|
||||
</span>
|
||||
)}
|
||||
</Link>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user