Skip to content

Commit ea46efc

Browse files
authored
fix: update confusing example in Coder plugin README (#115)
* fix: update confusing example in Coder plugin README * fix: remove accidental whitespace
1 parent e013e35 commit ea46efc

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

plugins/backstage-plugin-coder/README.md

+20-7
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ the Dev Container.
4747
3. Add the `CoderProvider` to the application:
4848

4949
```tsx
50-
// In packages/app/src/App.tsx
50+
// packages/app/src/App.tsx
51+
5152
import {
5253
type CoderAppConfig,
5354
CoderProvider,
@@ -94,14 +95,26 @@ the Dev Container.
9495
4. Add the `CoderWorkspacesCard` card to the entity page in your app:
9596

9697
```tsx
97-
// In packages/app/src/components/catalog/EntityPage.tsx
98-
import { CoderWorkspacesCard } from '@coder/backstage-plugin-coder';
98+
// packages/app/src/components/catalog/EntityPage.tsx
9999
100-
// ...
100+
import { CoderWorkspacesCard } from '@coder/backstage-plugin-coder';
101101
102-
<Grid item md={6} xs={12}>
103-
<CoderWorkspacesCard readEntityData />
104-
</Grid>;
102+
// We recommend placing the component inside of overviewContent
103+
const overviewContent = (
104+
<Grid container spacing={3} alignItems="stretch">
105+
{entityWarningContent}
106+
<Grid item md={6}>
107+
<EntityAboutCard variant="gridItem" />
108+
</Grid>
109+
110+
{/* Coder component should go inside Grid to help it work with MUI layouts */}
111+
<Grid item md={6} xs={12}>
112+
<CoderWorkspacesCard readEntityData />
113+
</Grid>
114+
115+
{/* Other elements for overviewContent go here */}
116+
</Grid>
117+
);
105118
```
106119

107120
### `app-config.yaml` files

0 commit comments

Comments
 (0)