Skip to content

Commit a8ffd26

Browse files
committed
fix: add question page inside container
this closes #44
1 parent e42b4c7 commit a8ffd26

File tree

1 file changed

+23
-21
lines changed

1 file changed

+23
-21
lines changed

plugins/qeta/src/components/QuestionPage/QuestionPage.tsx

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
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';
53
import {
64
Content,
75
ContentHeader,
6+
LinkButton,
87
WarningPanel,
98
} from '@backstage/core-components';
9+
import { useParams } from 'react-router-dom';
1010
import { useQetaApi, useStyles } from '../../utils/hooks';
1111
import { QuestionCard } from './QuestionCard';
1212
import { AnswerResponse, QuestionResponse } from '../../api';
@@ -84,24 +84,26 @@ export const QuestionPage = () => {
8484
</LinkButton>
8585
<AskQuestionButton />
8686
</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>
105107
</Content>
106108
);
107109
};

0 commit comments

Comments
 (0)