Revert props change

Signed-off-by: Andre Wanlin <awanlin@rapidrtc.com>
This commit is contained in:
Andre Wanlin
2022-03-28 14:28:55 -05:00
parent c530f3f546
commit af1ee27a67
5 changed files with 31 additions and 35 deletions
+3 -5
View File
@@ -95,11 +95,9 @@ export const Root = ({ children }: PropsWithChildren<{}>) => (
{/* Global nav, not org-specific */}
<SidebarItem icon={HomeIcon} to="catalog" text="Home" />
<MyGroupsSidebarItem
props={{
singularTitle: 'My Squad',
pluralTitle: 'My Squads',
icon: GroupIcon,
}}
singularTitle="My Squad"
pluralTitle="My Squads"
icon={GroupIcon}
/>
<SidebarItem icon={ExtensionIcon} to="api-docs" text="APIs" />
<SidebarItem icon={LibraryBooks} to="docs" text="Docs" />
+5 -5
View File
@@ -35,10 +35,10 @@ To use the MyGroupsSidebarItem you'll need to add it to your `Root.tsx` - found
{/* Global nav, not org-specific */}
//...
<SidebarItem icon={HomeIcon} to="catalog" text="Home" />
+ <MyGroupsSidebarItem props={{
+ singularTitle: "My Squad",
+ pluralTitle: "My Squads",
+ icon: GroupIcon}}
+ <MyGroupsSidebarItem
+ singularTitle='My Squad'
+ pluralTitle='My Squads'
+ icon={GroupIcon}
+ />
//...
</SidebarGroup>
@@ -53,6 +53,6 @@ Once added MyGroupsSidebarItem will work in three ways:
![MyGroupsSidebarItem single example](./docs/mygroupssidebaritem-single.png)
3. The user is logged in and a member of more than one group: the MyGroupsSidebarItem will display a single items with a submenu with all the related groups like this:
3. The user is logged in and a member of more than one group: the MyGroupsSidebarItem will display a single items with a sub-menu with all the related groups like this:
![MyGroupsSidebarItem multiple example](./docs/mygroupssidebaritem-multiple.png)
+7 -7
View File
@@ -66,14 +66,14 @@ export const MembersListCard: (_props: {
// @public
export const MyGroupsSidebarItem: ({
props,
singularTitle,
pluralTitle,
icon,
}: {
props: {
singularTitle: string;
pluralTitle: string;
icon: IconComponent;
};
}) => JSX.Element;
singularTitle: string;
pluralTitle: string;
icon: IconComponent;
}) => JSX.Element | null;
// Warning: (ae-missing-release-tag) "orgPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -47,11 +47,9 @@ describe('MyGroupsSidebarItem Test', () => {
]}
>
<MyGroupsSidebarItem
props={{
singularTitle: 'My Squad',
pluralTitle: 'My Squads',
icon: GroupIcon,
}}
singularTitle="My Squad"
pluralTitle="My Squads"
icon={GroupIcon}
/>
</TestApiProvider>,
{
@@ -103,11 +101,9 @@ describe('MyGroupsSidebarItem Test', () => {
]}
>
<MyGroupsSidebarItem
props={{
singularTitle: 'My Squad',
pluralTitle: 'My Squads',
icon: GroupIcon,
}}
singularTitle="My Squad"
pluralTitle="My Squads"
icon={GroupIcon}
/>
</TestApiProvider>,
{
@@ -187,11 +183,9 @@ describe('MyGroupsSidebarItem Test', () => {
]}
>
<MyGroupsSidebarItem
props={{
singularTitle: 'My Squad',
pluralTitle: 'My Squads',
icon: GroupIcon,
}}
singularTitle="My Squad"
pluralTitle="My Squads"
icon={GroupIcon}
/>
</TestApiProvider>,
{
@@ -40,11 +40,15 @@ import { getCompoundEntityRef } from '@backstage/catalog-model';
* @public
*/
export const MyGroupsSidebarItem = ({
props,
singularTitle,
pluralTitle,
icon,
}: {
props: { singularTitle: string; pluralTitle: string; icon: IconComponent };
singularTitle: string;
pluralTitle: string;
icon: IconComponent;
}) => {
const { singularTitle, pluralTitle, icon } = props;
// const { singularTitle, pluralTitle, icon } = props;
const identityApi = useApi(identityApiRef);
const catalogApi: CatalogApi = useApi(catalogApiRef);
const catalogEntityRoute = useRouteRef(entityRouteRef);