Skip to content

Commit

Permalink
doc: fix platformsh frontend plugin readme
Browse files Browse the repository at this point in the history
  • Loading branch information
zeshanziya committed Sep 16, 2024
1 parent 5b5de9f commit e020b6e
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions plugins/platformsh/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,24 @@ To get the Platform.sh component working, follow these steps:

To display the tab only for entities where `platform.sh/project-id: <project-id>` is available, the plugin provides a conditional export `isPlatformshAvailable`.

```ts
// At the top imports
import { EntityPlatformshContents, isPlatformshAvailable } from '@axelerant/backstage-plugin-platformsh';
// Add the tab conditionally based on annotation availability
const serviceEntityPage = (
<EntityLayout>
{/* other tabs... */}
<EntityLayout.Route path="/platformsh" title="Platform.sh" if={isPlatformshAvailable}>
<EntityPlatformshContents />
</EntityLayout.Route>
</EntityLayout>
);
```
```ts
// At the top imports
import {
EntityPlatformshContents,
isPlatformshAvailable,
} from '@axelerant/backstage-plugin-platformsh';
// Add the tab conditionally based on annotation availability
const serviceEntityPage = (
<EntityLayout>
{/* other tabs... */}
<EntityLayout.Route
path="/platformsh"
title="Platform.sh"
if={isPlatformshAvailable}
>
<EntityPlatformshContents />
</EntityLayout.Route>
</EntityLayout>
);
```

0 comments on commit e020b6e

Please sign in to comment.