Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor CSS in src/components/EventStats/Statistics/AverageRating.tsx #2902 #3205

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions src/components/EventStats/Statistics/AverageRating.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Rating from '@mui/material/Rating';
import FavoriteIcon from '@mui/icons-material/Favorite';
import FavoriteBorderIcon from '@mui/icons-material/FavoriteBorder';
import Typography from '@mui/material/Typography';

import styles from '../../../style/app.module.css';
// Props for the AverageRating component
type ModalPropType = {
data: {
Expand Down Expand Up @@ -33,7 +33,7 @@ type FeedbackType = {
export const AverageRating = ({ data }: ModalPropType): JSX.Element => {
return (
<>
<Card style={{ width: '300px' }}>
<Card className={styles.cardContainer}>
<Card.Body>
<Card.Title>
<h4>Average Review Score</h4>
Expand All @@ -50,13 +50,9 @@ export const AverageRating = ({ data }: ModalPropType): JSX.Element => {
icon={<FavoriteIcon fontSize="inherit" />}
size="medium"
emptyIcon={<FavoriteBorderIcon fontSize="inherit" />}
sx={{
'& .MuiRating-iconFilled': {
color: '#ff6d75', // Color for filled stars
},
'& .MuiRating-iconHover': {
color: '#ff3d47', // Color for star on hover
},
classes={{
iconFilled: styles.ratingFilled,
iconHover: styles.ratingHover,
}}
/>
</Card.Body>
Expand Down
11 changes: 11 additions & 0 deletions src/style/app.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,17 @@ hr {
.card {
width: fit-content;
}
.cardContainer {
width: 300px;
}

.ratingFilled {
color: #ff6d75; /* Color for filled stars */
}

.ratingHover {
color: #ff3d47; /* Color for star on hover */
}

.cardHeader {
padding: 1.25rem 1rem 1rem 1rem;
Expand Down
Loading