frontend-app-api: initial routing system implementation

Co-authored-by: Fredrik Adelöw <freben@gmail.com>
Co-authored-by: Philipp Hugenroth <philipph@spotify.com>
Co-authored-by: Johan Haals <johan.haals@gmail.com>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-09-01 15:05:18 +02:00
parent 91a534142d
commit 4d410e0985
10 changed files with 102 additions and 15 deletions
@@ -23,7 +23,6 @@ import React from 'react';
export const GraphiqlPage = createPageExtension({
id: 'graphiql.page',
defaultPath: '/graphiql',
disabled: true,
component: () =>
import('@backstage/plugin-graphiql').then(({ Router }) => <Router />),
});
@@ -21,7 +21,7 @@ import {
createPlugin,
useRouteRef,
} from '@backstage/frontend-plugin-api';
import { createRouteRef, createSubRouteRef } from '@backstage/core-plugin-api';
import { createRouteRef } from '@backstage/core-plugin-api';
import { Route, Routes } from 'react-router-dom';
const indexRouteRef = createRouteRef({ id: 'index' });
@@ -35,7 +35,7 @@ const page1RouteRef = createRouteRef({ id: 'page1' });
const IndexPage = createPageExtension({
id: 'index',
defaultPath: '/',
// indexRouteRef
routeRef: indexRouteRef,
component: async () => {
const Component = () => {
const page1Link = useRouteRef(page1RouteRef);