Fix usage examples

Signed-off-by: Divyanshi Gupta <divyanshigupta3295@gmail.com>
This commit is contained in:
Divyanshi Gupta
2023-01-19 22:15:19 +05:30
parent d20742a349
commit 3f88ae9d0a
2 changed files with 13 additions and 8 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-github-issues': patch
---
Updated README.md examples to use correct components and fixed some syntax errors.
+8 -8
View File
@@ -25,8 +25,8 @@ After installation, the plugin can be used as a Card or as a Page.
```typescript
import {
GitHubIssuesCard,
GitHubIssuesPage,
GithubIssuesCard,
GithubIssuesPage,
} from '@backstage/plugin-github-issues';
// To use as a page Plugin needs to be wrapped in EntityLayout.Route
@@ -34,9 +34,9 @@ const RenderGitHubIssuesPage = () => (
<EntityLayoutWrapper>
<EntityLayout.Route path="/" title="Overview">
<EntityLayout.Route path="github-issues" title="GitHub Issues">
<GitHubIssuesPage />
<GithubIssuesPage />
</EntityLayout.Route>
<EntityLayout.Route />
</EntityLayout.Route>
</EntityLayoutWrapper>
);
@@ -46,17 +46,17 @@ const RenderGitHubIssuesCard = () => (
<EntityLayout.Route path="/" title="Overview">
<Grid container spacing={3}>
<Grid item xs={12}>
<GitHubIssuesCard />
<GithubIssuesCard />
</Grid>
</Grid>
<EntityLayout.Route />
</EntityLayout.Route>
</EntityLayoutWrapper>
);
```
## Configuration
Both `GitHubIssuesPage` and `GitHubIssuesCard` provide default configuration. It is ready to use out of the box.
Both `GithubIssuesPage` and `GithubIssuesCard` provide default configuration. It is ready to use out of the box.
However, you can configure the plugin with props:
- `itemsPerPage: number = 10` - Issues in the list are paginated, number of issues on a single page is controlled with this prop
@@ -67,7 +67,7 @@ However, you can configure the plugin with props:
### `filterBy` and `orderBy` example
```ts
<GitHubIssuesCard
<GithubIssuesCard
filterBy={{
labels: ['bug', 'enhancement'],
states: ['OPEN'],