Skip to content

Commit

Permalink
Addressed review comments and cleaned code
Browse files Browse the repository at this point in the history
Signed-off-by: Yi Cai <yicai@redhat.com>
  • Loading branch information
ciiay committed Oct 24, 2024
1 parent d805202 commit 2143582
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 54 deletions.
2 changes: 0 additions & 2 deletions workspaces/topology/packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@
"@backstage/plugin-techdocs-react": "^1.2.9",
"@backstage/plugin-user-settings": "^0.8.14",
"@backstage/theme": "^0.6.0",
"@emotion/react": "^11.5.0",
"@emotion/styled": "^11.3.0",
"@mui/icons-material": "5.15.17",
"@mui/lab": "5.0.0-alpha.173",
"@mui/material": "5.15.17",
Expand Down
83 changes: 39 additions & 44 deletions workspaces/topology/packages/app/src/components/Root/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ import SearchIcon from '@mui/icons-material/Search';
import { MyGroupsSidebarItem } from '@backstage/plugin-org';
import GroupIcon from '@mui/icons-material/People';

import { ThemeProvider, useTheme } from '@mui/material/styles';

const useSidebarLogoStyles = makeStyles({
root: {
width: sidebarConfig.drawerWidthClosed,
Expand Down Expand Up @@ -74,49 +72,46 @@ const SidebarLogo = () => {
};

export const Root = ({ children }: PropsWithChildren<{}>) => {
const theme = useTheme();
return (
<ThemeProvider theme={theme}>
<SidebarPage>
<Sidebar>
<SidebarLogo />
<SidebarGroup label="Search" icon={<SearchIcon />} to="/search">
<SidebarSearchModal />
</SidebarGroup>
<SidebarDivider />
<SidebarGroup label="Menu" icon={<MenuIcon />}>
{/* Global nav, not org-specific */}
<SidebarItem icon={HomeIcon} to="catalog" text="Home" />
<MyGroupsSidebarItem
singularTitle="My Group"
pluralTitle="My Groups"
icon={GroupIcon}
/>
<SidebarItem icon={ExtensionIcon} to="api-docs" text="APIs" />
<SidebarItem icon={LibraryBooks} to="docs" text="Docs" />
<SidebarItem
icon={CreateComponentIcon}
to="create"
text="Create..."
/>
{/* End global nav */}
<SidebarDivider />
<SidebarScrollWrapper>
{/* Items in this group will be scrollable if they run out of space */}
</SidebarScrollWrapper>
</SidebarGroup>
<SidebarSpace />
<SidebarPage>
<Sidebar>
<SidebarLogo />
<SidebarGroup label="Search" icon={<SearchIcon />} to="/search">
<SidebarSearchModal />
</SidebarGroup>
<SidebarDivider />
<SidebarGroup label="Menu" icon={<MenuIcon />}>
{/* Global nav, not org-specific */}
<SidebarItem icon={HomeIcon} to="catalog" text="Home" />
<MyGroupsSidebarItem
singularTitle="My Group"
pluralTitle="My Groups"
icon={GroupIcon}
/>
<SidebarItem icon={ExtensionIcon} to="api-docs" text="APIs" />
<SidebarItem icon={LibraryBooks} to="docs" text="Docs" />
<SidebarItem
icon={CreateComponentIcon}
to="create"
text="Create..."
/>
{/* End global nav */}
<SidebarDivider />
<SidebarGroup
label="Settings"
icon={<UserSettingsSignInAvatar />}
to="/settings"
>
<SidebarSettings />
</SidebarGroup>
</Sidebar>
{children}
</SidebarPage>
</ThemeProvider>
<SidebarScrollWrapper>
{/* Items in this group will be scrollable if they run out of space */}
</SidebarScrollWrapper>
</SidebarGroup>
<SidebarSpace />
<SidebarDivider />
<SidebarGroup
label="Settings"
icon={<UserSettingsSignInAvatar />}
to="/settings"
>
<SidebarSettings />
</SidebarGroup>
</Sidebar>
{children}
</SidebarPage>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const entityWarningContent = (
const overviewContent = (
<Grid container spacing={3} alignItems="stretch">
{entityWarningContent}
<Grid item xs={6}>
<Grid item md={6}>
<EntityAboutCard variant="gridItem" />
</Grid>
<Grid item md={6} xs={12}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ const SearchPage = () => {
<Header title="Search" />
<Content>
<Grid container direction="row">
<Grid xs={12}>
<Grid item xs={12}>
<Paper className={classes.bar}>
<SearchBar />
</Paper>
</Grid>
<Grid xs={3}>
<Grid item xs={3}>
<SearchType.Accordion
name="Result Type"
defaultValue="software-catalog"
Expand Down Expand Up @@ -126,7 +126,7 @@ const SearchPage = () => {
/>
</Paper>
</Grid>
<Grid xs={9}>
<Grid item xs={9}>
<SearchPagination />
<SearchResult>
<CatalogSearchResultListItem icon={<CatalogIcon />} />
Expand Down
6 changes: 2 additions & 4 deletions workspaces/topology/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6267,7 +6267,7 @@ __metadata:
languageName: node
linkType: hard

"@emotion/react@npm:^11.10.5, @emotion/react@npm:^11.5.0":
"@emotion/react@npm:^11.10.5":
version: 11.13.3
resolution: "@emotion/react@npm:11.13.3"
dependencies:
Expand Down Expand Up @@ -6308,7 +6308,7 @@ __metadata:
languageName: node
linkType: hard

"@emotion/styled@npm:^11.10.5, @emotion/styled@npm:^11.3.0":
"@emotion/styled@npm:^11.10.5":
version: 11.13.0
resolution: "@emotion/styled@npm:11.13.0"
dependencies:
Expand Down Expand Up @@ -15680,8 +15680,6 @@ __metadata:
"@backstage/plugin-user-settings": ^0.8.14
"@backstage/test-utils": ^1.7.0
"@backstage/theme": ^0.6.0
"@emotion/react": ^11.5.0
"@emotion/styled": ^11.3.0
"@mui/icons-material": 5.15.17
"@mui/lab": 5.0.0-alpha.173
"@mui/material": 5.15.17
Expand Down

0 comments on commit 2143582

Please sign in to comment.