diff --git a/client/src/components/ListQuestion.jsx b/client/src/components/ListQuestion.jsx index 98e8808..9240bb0 100644 --- a/client/src/components/ListQuestion.jsx +++ b/client/src/components/ListQuestion.jsx @@ -1,8 +1,9 @@ -import { Divider, Grid, ListItem, Stack, Typography, useMediaQuery } from '@mui/material'; +import { Divider, Grid, ListItem, Stack, Typography, Chip } from '@mui/material'; import { Link } from 'react-router-dom'; import { CreationInfoTag } from 'controllers'; import ListQuestionInfo from './ListQuestionInfo'; +import { useMediaQuery } from '@mui/material'; export default function ListQuestion({ question_id, answers, @@ -24,13 +25,38 @@ export default function ListQuestion({ - - - {sm || md ? : null} - - + {(sm || md) && ( + + + + + + )} + - {sm || md ? null : } + {sm || md ? null : ( + + )} - [{status}] {title} + [{status}] {title}{' '} + {text.replace(/<[^>]*>?/gm, '')} + {tags.length > 0 && ( + + Tags:{' '} + {tags.map((tag, index) => ( + + ))} + + )} diff --git a/client/src/components/ListQuestionInfo.jsx b/client/src/components/ListQuestionInfo.jsx index 9edc4d8..f85dc6d 100644 --- a/client/src/components/ListQuestionInfo.jsx +++ b/client/src/components/ListQuestionInfo.jsx @@ -1,33 +1,24 @@ import { Chip, Typography } from '@mui/material'; -export default function ListQuestionInfo({ answers, downvotes, inline, hasAcceptedAnswer, tags, upvotes, views }) { +export default function ListQuestionInfo({ + answers, + downvotes, + inline, + hasAcceptedAnswer, + tags, + upvotes, + views, +}) { return inline ? ( <> {upvotes - downvotes} votes | {answers} answers | {views} views - - Accepted: - - - Tags: {tags.join(', ')} ) : ( <> {upvotes - downvotes} votes {answers} answers {views} views - - Accepted: - - Tags: {tags.join(', ')} - ) -} \ No newline at end of file + ); +}