app,create-app: remove / prefixes in sidebar items

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2021-08-07 13:54:35 +02:00
parent 55a5dbd547
commit 9f8f8dd6b4
4 changed files with 15 additions and 3 deletions
+12
View File
@@ -0,0 +1,12 @@
---
'@backstage/create-app': patch
---
Removed the `/` prefix in the catalog `SidebarItem` element, as it is no longer needed.
To apply this change to an existing app, remove the `/` prefix from the catalog and any other sidebar items in `packages/app/src/components/Root/Root.ts`:
```diff
-<SidebarItem icon={HomeIcon} to="/catalog" text="Home" />
+<SidebarItem icon={HomeIcon} to="catalog" text="Home" />
```
+1 -1
View File
@@ -82,7 +82,7 @@ export const Root = ({ children }: PropsWithChildren<{}>) => (
<SidebarSearch />
<SidebarDivider />
{/* Global nav, not org-specific */}
<SidebarItem icon={HomeIcon} to="/catalog" text="Home" />
<SidebarItem icon={HomeIcon} to="catalog" text="Home" />
<SidebarItem icon={ExtensionIcon} to="api-docs" text="APIs" />
<SidebarItem icon={LibraryBooks} to="docs" text="Docs" />
<SidebarItem icon={LayersIcon} to="explore" text="Explore" />
@@ -77,7 +77,7 @@ export const Root = ({ children }: PropsWithChildren<{}>) => (
<SidebarSearch />
<SidebarDivider />
{/* Global nav, not org-specific */}
<SidebarItem icon={HomeIcon} to="/catalog" text="Home" />
<SidebarItem icon={HomeIcon} to="catalog" text="Home" />
<SidebarItem icon={ExtensionIcon} to="api-docs" text="APIs" />
<SidebarItem icon={LibraryBooks} to="docs" text="Docs" />
<SidebarItem icon={CreateComponentIcon} to="create" text="Create..." />
+1 -1
View File
@@ -80,7 +80,7 @@ sidebar:
export const Root = ({ children }: PropsWithChildren<{}>) => (
<SidebarPage>
<Sidebar>
+ <SidebarItem icon={HomeIcon} to="/catalog" text="Home" />
+ <SidebarItem icon={HomeIcon} to="catalog" text="Home" />
...
</Sidebar>
```