|
1 | 1 | import React from 'react';
|
2 |
| -import { Box, Divider, Typography } from '@material-ui/core'; |
3 |
| -import { LinkButton } from '@backstage/core-components'; |
4 |
| -import { useParams } from 'react-router-dom'; |
| 2 | +import { Box, Container, Divider, Typography } from '@material-ui/core'; |
5 | 3 | import {
|
6 | 4 | Content,
|
7 | 5 | ContentHeader,
|
| 6 | + LinkButton, |
8 | 7 | WarningPanel,
|
9 | 8 | } from '@backstage/core-components';
|
| 9 | +import { useParams } from 'react-router-dom'; |
10 | 10 | import { useQetaApi, useStyles } from '../../utils/hooks';
|
11 | 11 | import { QuestionCard } from './QuestionCard';
|
12 | 12 | import { AnswerResponse, QuestionResponse } from '../../api';
|
@@ -84,24 +84,26 @@ export const QuestionPage = () => {
|
84 | 84 | </LinkButton>
|
85 | 85 | <AskQuestionButton />
|
86 | 86 | </ContentHeader>
|
87 |
| - <QuestionCard question={question} /> |
88 |
| - <Box sx={{ mt: 3, mb: 2 }}> |
89 |
| - <Typography variant="h6"> |
90 |
| - {question.answersCount + newAnswers.length} answers |
91 |
| - </Typography> |
92 |
| - </Box> |
93 |
| - {(question.answers ?? []).concat(newAnswers).map(a => { |
94 |
| - return ( |
95 |
| - <> |
96 |
| - <Divider className={styles.questionDivider} /> |
97 |
| - <Box key={a.id} sx={{ mb: 1 }}> |
98 |
| - <AnswerCard answer={a} question={question} /> |
99 |
| - </Box> |
100 |
| - </> |
101 |
| - ); |
102 |
| - })} |
103 |
| - <Divider className={styles.questionDivider} /> |
104 |
| - <AnswerForm question={question} onPost={onAnswerPost} /> |
| 87 | + <Container maxWidth="md"> |
| 88 | + <QuestionCard question={question} /> |
| 89 | + <Box sx={{ mt: 3, mb: 2 }}> |
| 90 | + <Typography variant="h6"> |
| 91 | + {question.answersCount + newAnswers.length} answers |
| 92 | + </Typography> |
| 93 | + </Box> |
| 94 | + {(question.answers ?? []).concat(newAnswers).map(a => { |
| 95 | + return ( |
| 96 | + <> |
| 97 | + <Divider className={styles.questionDivider} /> |
| 98 | + <Box key={a.id} sx={{ mb: 1 }}> |
| 99 | + <AnswerCard answer={a} question={question} /> |
| 100 | + </Box> |
| 101 | + </> |
| 102 | + ); |
| 103 | + })} |
| 104 | + <Divider className={styles.questionDivider} /> |
| 105 | + <AnswerForm question={question} onPost={onAnswerPost} /> |
| 106 | + </Container> |
105 | 107 | </Content>
|
106 | 108 | );
|
107 | 109 | };
|
0 commit comments