diff --git a/.changeset/lazy-terms-shake.md b/.changeset/lazy-terms-shake.md new file mode 100644 index 0000000000..41f5292709 --- /dev/null +++ b/.changeset/lazy-terms-shake.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-linguist': minor +--- + +Allow to optionally pass component's title as LinguistCard parameter diff --git a/plugins/linguist/README.md b/plugins/linguist/README.md index 7ad70f1db6..72855c0894 100644 --- a/plugins/linguist/README.md +++ b/plugins/linguist/README.md @@ -79,6 +79,12 @@ To setup the Linguist Card frontend you'll need to do the following steps: ``` +3. (optionally) Set component's title - default is "Languages" + + ```tsx + + ``` + **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 diff --git a/plugins/linguist/src/components/LinguistCard/LinguistCard.tsx b/plugins/linguist/src/components/LinguistCard/LinguistCard.tsx index 6a07a958c2..3b63abd406 100644 --- a/plugins/linguist/src/components/LinguistCard/LinguistCard.tsx +++ b/plugins/linguist/src/components/LinguistCard/LinguistCard.tsx @@ -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 ( - +