diff --git a/plugins/catalog/package.json b/plugins/catalog/package.json index eb8672bc42..d7329e4b2f 100644 --- a/plugins/catalog/package.json +++ b/plugins/catalog/package.json @@ -30,6 +30,7 @@ "@material-ui/core": "^4.9.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.45", + "moment": "^2.26.0", "react": "^16.13.1", "react-dom": "^16.13.1", "react-router": "^6.0.0-alpha.5", diff --git a/plugins/catalog/src/components/CatalogPage/CatalogLayout.tsx b/plugins/catalog/src/components/CatalogPage/CatalogLayout.tsx new file mode 100644 index 0000000000..9eccf81818 --- /dev/null +++ b/plugins/catalog/src/components/CatalogPage/CatalogLayout.tsx @@ -0,0 +1,46 @@ +/* + * Copyright 2020 Spotify AB + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import React, { FC } from 'react'; +import { Header, HomepageTimer, Page, pageTheme } from '@backstage/core'; +import { getTimeBasedGreeting } from './utils/timeUtil'; + +const CatalogLayout: FC<{}> = props => { + const { children } = props; + // const profile = useProfile(); + const profile = { givenName: 'friend' }; + const greeting = getTimeBasedGreeting(); + + return ( + +
+ +
+ {children} +
+ ); +}; + +export default CatalogLayout; diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx index 7601031699..2e1989323c 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.test.tsx @@ -64,7 +64,7 @@ describe('CatalogPage', () => { ), ); expect( - await rendered.findByText('Keep track of your software'), + await rendered.findByText('Backstage Service Catalog'), ).toBeInTheDocument(); }); }); diff --git a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx index c8074b1cc9..3ba63188c1 100644 --- a/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx +++ b/plugins/catalog/src/components/CatalogPage/CatalogPage.tsx @@ -19,14 +19,11 @@ import { Content, ContentHeader, DismissableBanner, - Header, HeaderTabs, - HomepageTimer, - Page, - pageTheme, SupportButton, useApi, } from '@backstage/core'; +import CatalogLayout from './CatalogLayout'; import { rootRoute as scaffolderRootRoute } from '@backstage/plugin-scaffolder'; import { Button, Link, makeStyles, Typography } from '@material-ui/core'; import Edit from '@material-ui/icons/Edit'; @@ -155,10 +152,7 @@ export const CatalogPage: FC<{}> = () => { ]; return ( - -
- -
+ = () => { } id="catalog_page_welcome_banner" /> -