Skip to content

Commit

Permalink
graphiql,app: export icon and avoid routeRef usage in SidebarItem
Browse files Browse the repository at this point in the history
Co-authored-by: Juan Lulkin <[email protected]>
Signed-off-by: Patrik Oldsberg <[email protected]>
  • Loading branch information
Rugvip and Juan Lulkin committed Mar 11, 2021
1 parent 9804a52 commit 09eb54e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/dirty-flowers-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@backstage/plugin-graphiql': patch
---

Export `GraphiQLIcon`.
8 changes: 2 additions & 6 deletions packages/app/src/components/Root/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
SidebarSpace,
} from '@backstage/core';
import { NavLink } from 'react-router-dom';
import { graphiQLRouteRef } from '@backstage/plugin-graphiql';
import { GraphiQLIcon } from '@backstage/plugin-graphiql';
import { Settings as SidebarSettings } from '@backstage/plugin-user-settings';
import { SidebarSearch } from '@backstage/plugin-search';

Expand Down Expand Up @@ -90,11 +90,7 @@ const Root = ({ children }: PropsWithChildren<{}>) => (
<SidebarItem icon={MapIcon} to="tech-radar" text="Tech Radar" />
<SidebarItem icon={RuleIcon} to="lighthouse" text="Lighthouse" />
<SidebarItem icon={MoneyIcon} to="cost-insights" text="Cost Insights" />
<SidebarItem
icon={graphiQLRouteRef.icon!}
to={graphiQLRouteRef.path}
text={graphiQLRouteRef.title}
/>
<SidebarItem icon={GraphiQLIcon} to="graphiql" text="GraphiQL" />
<SidebarSpace />
<SidebarDivider />
<SidebarSettings />
Expand Down
4 changes: 4 additions & 0 deletions plugins/graphiql/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
* limitations under the License.
*/

import { IconComponent } from '@backstage/core';
import GraphiQLIconComponent from './assets/graphiql.icon.svg';

export {
graphiqlPlugin,
graphiqlPlugin as plugin,
Expand All @@ -22,3 +25,4 @@ export {
export { GraphiQLPage as Router } from './components';
export * from './lib/api';
export * from './route-refs';
export const GraphiQLIcon: IconComponent = GraphiQLIconComponent;

0 comments on commit 09eb54e

Please sign in to comment.