diff --git a/packages/app-next/src/App.tsx b/packages/app-next/src/App.tsx index b875fb3927..82b0c927e9 100644 --- a/packages/app-next/src/App.tsx +++ b/packages/app-next/src/App.tsx @@ -17,6 +17,7 @@ import { graphiqlPlugin as legacyGraphiqlPlugin } from '@backstage/plugin-graphiql'; import { createApp as createLegacyApp } from '@backstage/app-defaults'; import { createApp } from '@backstage/frontend-app-api'; +import { pagesPlugin } from './examples/pagesPlugin'; import { graphiqlPlugin } from './examples/graphiqlPlugin'; /* @@ -49,7 +50,7 @@ TODO: /* app.tsx */ const app = createApp({ - plugins: [graphiqlPlugin], + plugins: [graphiqlPlugin, pagesPlugin], // bindRoutes({ bind }) { // bind(catalogPlugin.externalRoutes, { // createComponent: scaffolderPlugin.routes.root, diff --git a/packages/app-next/src/examples/pagesPlugin.tsx b/packages/app-next/src/examples/pagesPlugin.tsx new file mode 100644 index 0000000000..4bb0b76ad7 --- /dev/null +++ b/packages/app-next/src/examples/pagesPlugin.tsx @@ -0,0 +1,62 @@ +/* + * Copyright 2023 The Backstage Authors + * + * 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 from 'react'; +import { Link } from '@backstage/core-components'; +import { + createPageExtension, + createPlugin, +} from '@backstage/frontend-plugin-api'; + +const IndexPage = createPageExtension({ + id: 'index', + defaultPath: '/', + component: async () => { + const Component = () => { + // const page1 = useRouteRef(); + return ( +