Skip to content

Commit

Permalink
changed the individual feature reviews to pill form to match the figma
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyrus Irani committed Sep 25, 2023
1 parent 6970c5e commit 96d095b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 16 deletions.
45 changes: 30 additions & 15 deletions frontend/src/components/utils/LabeledLinearProgress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,40 @@ type Props = {
};

const useStyles = makeStyles((theme) => ({
bar: {
width: '90%',
barContainer: {
display: 'flex',
alignItems: 'center',
},
barSegment: {
flex: 1,
height: '8px', // Adjust the height as needed
borderRadius: '4px', // Adjust the border radius as needed
marginRight: '4px', // Add a small gap between segments
},
aveRating: {
marginLeft: '8px', // Add spacing between the segments and the rating
},
}));

export default function LabeledLinearProgress({ value }: Props): ReactElement {
const { bar } = useStyles();
const { barContainer, barSegment, aveRating } = useStyles();

const segments = Array.from({ length: 5 }, (_, index) => (
<div
key={index}
className={barSegment}
style={{
backgroundColor: index < value ? '#B94630' : 'gray', // Change color based on the rating
}}
></div>
));

return (
<Box className={styles.barContainer} display="flex" alignItems="center">
<Box width="90%" mr={1}>
<LinearProgress className={bar} variant="determinate" value={value * 20} />
</Box>
<Box minWidth={35}>
<Typography
className={styles.aveRating}
variant="body2"
color="textSecondary"
>{`${value.toFixed(1)}`}</Typography>
</Box>
</Box>
<div className={barContainer}>
{segments}
<Typography className={aveRating} variant="body2" color="textSecondary">
{`${value.toFixed(1)}`}
</Typography>
</div>
);
}
1 change: 0 additions & 1 deletion frontend/src/pages/ApartmentPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,6 @@ const ApartmentPage = ({ user, setUser }: Props): ReactElement => {
</Grid>
</>
);

const InfoSection = landlordData && (
<Grid item xs={12} sm={4}>
<AptInfo
Expand Down

0 comments on commit 96d095b

Please sign in to comment.