Parameterize LinguistCard title
Signed-off-by: Piotr Piątkiewicz <piatkiewicz.piotr@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-linguist': minor
|
||||
---
|
||||
|
||||
Allow to optionally pass component's title as LinguistCard parameter
|
||||
@@ -79,6 +79,12 @@ To setup the Linguist Card frontend you'll need to do the following steps:
|
||||
</Grid>
|
||||
```
|
||||
|
||||
3. (optionally) Set component's title - default is "Languages"
|
||||
|
||||
```tsx
|
||||
<EntityLinguistCard title="Tech stack" />
|
||||
```
|
||||
|
||||
**Notes:**
|
||||
|
||||
- The `if` prop is optional on the `EntitySwitch.Case`, you can remove it if you always want to see the tab even if the entity being viewed does not have the needed annotation
|
||||
|
||||
@@ -55,7 +55,7 @@ const useStyles = makeStyles(theme => ({
|
||||
},
|
||||
}));
|
||||
|
||||
export const LinguistCard = () => {
|
||||
export const LinguistCard = ({ title = 'Languages' }) => {
|
||||
const classes = useStyles();
|
||||
const theme = useTheme();
|
||||
const { entity } = useEntity();
|
||||
@@ -70,7 +70,7 @@ export const LinguistCard = () => {
|
||||
|
||||
if (items && items.languageCount === 0 && items.totalBytes === 0) {
|
||||
return (
|
||||
<InfoCard title="Languages" className={classes.infoCard}>
|
||||
<InfoCard title={title} className={classes.infoCard}>
|
||||
<Grid container spacing={3}>
|
||||
<Box p={2}>
|
||||
<Typography>
|
||||
|
||||
Reference in New Issue
Block a user