File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -86,3 +86,35 @@ export const Root = ({ children }: PropsWithChildren<{}>) => (
86
86
An interface for Q&A is now available at ` / qeta ` .
87
87
88
88
QetaPage also takes optional properties if you want to change the page title/subtitle/elements shown in the header.
89
+
90
+ ### Adding questions to entity page
91
+
92
+ You can also add questions list to any entity page. This will render questions related to that entity. First
93
+ create the questions component:
94
+
95
+ ` ` ` ts
96
+ import { useEntity } from ' @backstage/plugin-catalog-react' ;
97
+ import { Container } from ' @material-ui/core' ;
98
+ import { stringifyEntityRef } from ' @backstage/catalog-model' ;
99
+ import React from ' react' ;
100
+ import { QuestionsContainer } from ' @drodil/backstage-plugin-qeta' ;
101
+
102
+ export const QetaContent = () => {
103
+ const { entity } = useEntity ();
104
+
105
+ return (
106
+ <Container >
107
+ < QuestionsContainer entity = {stringifyEntityRef(entity )} showTitle / >
108
+ < / Container >
109
+ );
110
+ };
111
+ ` ` `
112
+
113
+ Then add it to your entity page:
114
+
115
+ ` ` ` ts
116
+ // EntityPage.tsx
117
+ < EntityLayout .Route path = " /qeta" title = " Q&A" >
118
+ < QetaContent / >
119
+ < / EntityLayout .Route > ,
120
+ ` ` `
You can’t perform that action at this time.
0 commit comments