Skip to content

Commit

Permalink
ADD content summaries to post list items
Browse files Browse the repository at this point in the history
```
  • Loading branch information
dolf321 committed Jul 20, 2023
1 parent c2ad04d commit b3d47f6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
6 changes: 5 additions & 1 deletion web/src/components/forums/PostListItem/PostListItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default function PostListItem({
title,
category,
user,
content,
date,
seenCount,
seen = false,
Expand All @@ -35,7 +36,10 @@ export default function PostListItem({
<Typography className={classes.title}>
{title}
</Typography>
<Box className={classes.error}>
<Typography variant="body2" className={classes.summary}>
{content}
</Typography>
<Box className={classes.dataSummary}>
<Box className={classes.infoContainer}>
<VisibilityIcon className={classes.icon} />
<Typography>
Expand Down
13 changes: 12 additions & 1 deletion web/src/components/forums/PostListItem/PostListItem.styles.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const useStyles = makeStyles((theme) => ({
borderRadius: '3px',
width: '100%',
display: 'flex',
overflow: 'hidden',
alignItems: 'center',
gap: theme.spacing(1.5),
cursor: 'pointer',
Expand All @@ -30,11 +31,20 @@ export const useStyles = makeStyles((theme) => ({
},
content: {
display: 'flex',
overflow: 'hidden',
flexDirection: 'column',
justifyContent: 'center',
gap: '5px',
},
error: {
summary: { // i want two lines of text
margin: 0,
opacity: '.8',
fontSize: '0.8rem',
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
},
dataSummary: {
display: 'flex',
alignItems: 'center',
gap: '10px',
Expand All @@ -48,6 +58,7 @@ export const useStyles = makeStyles((theme) => ({
display: 'flex',
alignItems: 'center',
gap: '5px',
fontSize: '0.8rem',
},
icon: {
fontSize: '14px',
Expand Down

0 comments on commit b3d47f6

Please sign in to comment.