File tree Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -62,10 +62,12 @@ import { QetaPage } from '@drodil/backstage-plugin-qeta';
62
62
const AppRoutes = () => (
63
63
<FlatRoutes >
64
64
// ...
65
- < Route path = " /qeta" element = {<QetaPage />} / >
65
+ < Route path = " /qeta" element = {<QetaPage title = " Questions " / >} / >
66
66
// ...
67
67
</FlatRoutes>
68
68
);
69
69
` ` `
70
70
71
71
An interface for Q&A is now available at ` /qeta ` .
72
+
73
+ QetaPage also takes optional properties if you want to change the page title/subtitle/elements shown in the header.
Original file line number Diff line number Diff line change @@ -32,7 +32,12 @@ const qetaDevPlugin = createPlugin({
32
32
createDevApp ( )
33
33
. registerPlugin ( qetaDevPlugin )
34
34
. addPage ( {
35
- element : < QetaPage /> ,
35
+ element : (
36
+ < QetaPage
37
+ title = "Questions and answers"
38
+ subtitle = "We have answers to everything!"
39
+ />
40
+ ) ,
36
41
title : 'Root Page' ,
37
42
path : '/qeta' ,
38
43
} )
Original file line number Diff line number Diff line change @@ -58,9 +58,17 @@ export const HomePageContent = () => {
58
58
) ;
59
59
} ;
60
60
61
- export const HomePage = ( ) => (
61
+ type Props = {
62
+ title ?: string ;
63
+ subtitle ?: string ;
64
+ headerElements ?: JSX . Element [ ] ;
65
+ } ;
66
+
67
+ export const HomePage = ( props : Props ) => (
62
68
< Page themeId = "tool" >
63
- < Header title = "Q& A " style = { { paddingTop : '1rem' , paddingBottom : '1rem' } } />
69
+ < Header title = { props . title ?? 'Q&A' } subtitle = { props . subtitle } >
70
+ { props . headerElements }
71
+ </ Header >
64
72
< Routes >
65
73
< Route path = "/" element = { < HomePageContent /> } />
66
74
< Route path = "/ask" element = { < AskPage /> } />
You can’t perform that action at this time.
0 commit comments