diff --git a/demo/shared.py b/demo/shared.py index 8f3f12f1..70b44de4 100644 --- a/demo/shared.py +++ b/demo/shared.py @@ -11,7 +11,7 @@ def demo_page(*components: AnyComponent, title: str | None = None) -> list[AnyCo c.Navbar( title='FastUI Demo', title_event=GoToEvent(url='/'), - links=[ + start_links=[ c.Link( components=[c.Text(text='Components')], on_click=GoToEvent(url='/components'), diff --git a/src/npm-fastui-bootstrap/src/navbar.tsx b/src/npm-fastui-bootstrap/src/navbar.tsx index 4e84faf6..3f5adec8 100644 --- a/src/npm-fastui-bootstrap/src/navbar.tsx +++ b/src/npm-fastui-bootstrap/src/navbar.tsx @@ -3,7 +3,11 @@ import { components, useClassName, models } from 'fastui' import BootstrapNavbar from 'react-bootstrap/Navbar' export const Navbar: FC = (props) => { - const links = props.links.map((link) => { + const startLinks = props.startLinks.map((link) => { + link.mode = link.mode || 'navbar' + return link + }) + const endLinks = props.endLinks.map((link) => { link.mode = link.mode || 'navbar' return link }) @@ -14,7 +18,14 @@ export const Navbar: FC = (props) => {
    - {links.map((link, i) => ( + {startLinks.map((link, i) => ( +
  • + +
  • + ))} +
+
    + {endLinks.map((link, i) => (
  • diff --git a/src/npm-fastui/src/components/navbar.tsx b/src/npm-fastui/src/components/navbar.tsx index 8d6c81a3..6e735fe8 100644 --- a/src/npm-fastui/src/components/navbar.tsx +++ b/src/npm-fastui/src/components/navbar.tsx @@ -5,7 +5,11 @@ import { useClassName } from '../hooks/className' import { LinkComp, LinkRender } from './link' export const NavbarComp = (props: Navbar) => { - const links = props.links.map((link) => { + const startLinks = props.startLinks.map((link) => { + link.mode = link.mode || 'navbar' + return link + }) + const endLinks = props.endLinks.map((link) => { link.mode = link.mode || 'navbar' return link }) @@ -13,7 +17,10 @@ export const NavbarComp = (props: Navbar) => {