-
Notifications
You must be signed in to change notification settings - Fork 0
redesign cart shopping #98
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,22 @@ | ||||||||||||||||||||||||||||||
| import { Paper, Box } from '@mui/material'; | ||||||||||||||||||||||||||||||
| import { Paper, Box , Grid, Divider} from '@mui/material'; | ||||||||||||||||||||||||||||||
| import { styled } from '@mui/material/styles'; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| import SharedTypography from '../shared/Text/SharedTypography.jsx'; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| export const GridContainer = styled(Grid)(({ theme }) => ({ | ||||||||||||||||||||||||||||||
| width: '100vw', | ||||||||||||||||||||||||||||||
| paddingLeft: theme.spacing(10), | ||||||||||||||||||||||||||||||
| paddingRight: theme.spacing(10), | ||||||||||||||||||||||||||||||
| paddingTop: theme.spacing(6), | ||||||||||||||||||||||||||||||
| paddingBottom: theme.spacing(6), | ||||||||||||||||||||||||||||||
| })); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| export const CartTitle = styled(SharedTypography)({ | ||||||||||||||||||||||||||||||
| marginBottom: '32px', | ||||||||||||||||||||||||||||||
| fontSize: '1.7rem', | ||||||||||||||||||||||||||||||
| fontWeight: 800, | ||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| export const EmptyCartContainer = styled(Box)(({ theme }) => ({ | ||||||||||||||||||||||||||||||
| maxWidth: '30rem', | ||||||||||||||||||||||||||||||
| marginInline: 'auto', | ||||||||||||||||||||||||||||||
|
|
@@ -14,33 +30,97 @@ export const EmptyCartContainer = styled(Box)(({ theme }) => ({ | |||||||||||||||||||||||||||||
| gap: '2rem', | ||||||||||||||||||||||||||||||
| })); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| export const CartContainer = styled(Box)(({ theme }) => ({ | ||||||||||||||||||||||||||||||
| padding: '2rem', | ||||||||||||||||||||||||||||||
| backgroundColor: theme.palette.background.paper, | ||||||||||||||||||||||||||||||
| borderRadius: theme.shape.custom?.roundedLg || '0.75rem', | ||||||||||||||||||||||||||||||
| boxShadow: theme.shadows[2], | ||||||||||||||||||||||||||||||
| margin: '2rem auto', | ||||||||||||||||||||||||||||||
| maxWidth: '62.5rem', | ||||||||||||||||||||||||||||||
| width: '100%', | ||||||||||||||||||||||||||||||
| display: 'flex', | ||||||||||||||||||||||||||||||
| flexDirection: 'column', | ||||||||||||||||||||||||||||||
| gap: '2rem', | ||||||||||||||||||||||||||||||
| export const CartContainer = styled('div')(() => ({ | ||||||||||||||||||||||||||||||
| width: '100vw', | ||||||||||||||||||||||||||||||
| minHeight: '100vh', | ||||||||||||||||||||||||||||||
| paddingTop: '1rem', | ||||||||||||||||||||||||||||||
| paddingBottom: '3rem', | ||||||||||||||||||||||||||||||
| paddingLeft: '6vw', | ||||||||||||||||||||||||||||||
| paddingRight: '6vw', | ||||||||||||||||||||||||||||||
| backgroundColor: '#f9f9f9', | ||||||||||||||||||||||||||||||
| boxSizing: 'border-box', | ||||||||||||||||||||||||||||||
| })); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| export const CartItemWrapper = styled(Paper)(({ theme }) => ({ | ||||||||||||||||||||||||||||||
| padding: '1rem', | ||||||||||||||||||||||||||||||
| borderRadius: '0.75rem', | ||||||||||||||||||||||||||||||
| export const CartItemCard = styled(Paper)(() => ({ | ||||||||||||||||||||||||||||||
| display: 'flex', | ||||||||||||||||||||||||||||||
| flexDirection: 'column', | ||||||||||||||||||||||||||||||
| alignItems: 'center', | ||||||||||||||||||||||||||||||
| boxShadow: theme.shadows[1], | ||||||||||||||||||||||||||||||
| width: '80%', | ||||||||||||||||||||||||||||||
| margin: '0 auto', | ||||||||||||||||||||||||||||||
| flexDirection: 'row', | ||||||||||||||||||||||||||||||
| alignItems: 'flex-start', | ||||||||||||||||||||||||||||||
| padding: '2.5rem', | ||||||||||||||||||||||||||||||
| marginBottom: '3rem', | ||||||||||||||||||||||||||||||
| borderRadius: '1.5rem', | ||||||||||||||||||||||||||||||
| boxShadow: '0 6px 25px rgba(0, 0, 0, 0.08)', | ||||||||||||||||||||||||||||||
| width: '100%', | ||||||||||||||||||||||||||||||
| minHeight: '200px', | ||||||||||||||||||||||||||||||
| })); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| export const ProductImage = { | ||||||||||||||||||||||||||||||
| width: '150px', | ||||||||||||||||||||||||||||||
| height: '150px', | ||||||||||||||||||||||||||||||
| objectFit: 'cover', | ||||||||||||||||||||||||||||||
| borderRadius: '14px', | ||||||||||||||||||||||||||||||
| marginRight: '2rem', | ||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||
|
Comment on lines
+56
to
+62
|
||||||||||||||||||||||||||||||
| export const ProductImage = { | |
| width: '150px', | |
| height: '150px', | |
| objectFit: 'cover', | |
| borderRadius: '14px', | |
| marginRight: '2rem', | |
| }; | |
| export const ProductImage = styled('img')(() => ({ | |
| width: '150px', | |
| height: '150px', | |
| objectFit: 'cover', | |
| borderRadius: '14px', | |
| marginRight: '2rem', | |
| })); |
Copilot
AI
Aug 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ProductName styled component duplicates styling that already exists in textVariants.js (PRODUCT_TITLE). Consider using the existing text variant instead of creating duplicate styles.
| export const ProductName = styled('div')(() => ({ | |
| fontWeight: 800, | |
| fontSize: '1.6rem', | |
| marginBottom: '1rem', | |
| textTransform: 'capitalize', | |
| })); | |
| // Use <SharedTypography variant="PRODUCT_TITLE" /> for product names instead of a custom styled component. |
Copilot
AI
Aug 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ProductPrice styled component duplicates styling that already exists in textVariants.js (PRODUCT_PRICE). Consider using the existing text variant instead of creating duplicate styles.
| export const ProductPrice = styled('div')(() => ({ | |
| fontWeight: 700, | |
| fontSize: '1.4rem', | |
| color: '#111', | |
| marginBottom: '1rem', | |
| })); | |
| export const ProductPrice = styled(SharedTypography)({ | |
| marginBottom: '1rem', | |
| }); |
Copilot
AI
Aug 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ProductLocation styled component duplicates styling that already exists in textVariants.js (PRODUCT_LOCATION). Consider using the existing text variant instead of creating duplicate styles.
| export const ProductLocation = styled('div')(() => ({ | |
| fontSize: '1.1rem', | |
| color: 'gray', | |
| marginBottom: '2rem', | |
| })); | |
| export const ProductLocation = styled(SharedTypography).attrs({ | |
| variant: 'PRODUCT_LOCATION', | |
| })({ | |
| marginBottom: '2rem', | |
| }); |
Copilot
AI
Aug 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SummaryTitle styled component duplicates styling that already exists in textVariants.js (SECTION_TITLE). Consider using the existing text variant instead of creating duplicate styles.
| export const SummaryTitle = styled('div')(() => ({ | |
| fontWeight: 800, | |
| fontSize: '1.5rem', | |
| marginBottom: '2rem', | |
| })); | |
| // Use SharedTypography with variant="SECTION_TITLE" instead of SummaryTitle |
Copilot
AI
Aug 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SummaryRow styled component duplicates styling that already exists in textVariants.js (SUMMARY_ROW). Consider using the existing text variant instead of creating duplicate styles.
| export const SummaryRow = styled('div')(() => ({ | |
| display: 'flex', | |
| justifyContent: 'space-between', | |
| fontSize: '1.2rem', | |
| marginBottom: '1.2rem', | |
| })); | |
| // Removed duplicate SummaryRow styled component. Use SharedTypography with variant="SUMMARY_ROW" instead. |
Copilot
AI
Aug 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SummaryTotal styled component duplicates styling that already exists in textVariants.js (SECTION_TOTAL). Consider using the existing text variant instead of creating duplicate styles.
| export const SummaryTotal = styled('div')(() => ({ | |
| display: 'flex', | |
| justifyContent: 'space-between', | |
| fontWeight: 800, | |
| fontSize: '1.4rem', | |
| })); | |
| export const SummaryTotal = styled(SharedTypography).attrs({ | |
| variant: 'SECTION_TOTAL', | |
| })({ | |
| display: 'flex', | |
| justifyContent: 'space-between', | |
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,10 @@ | ||
| import { Card, Box } from '@mui/material'; | ||
| import { styled } from '@mui/material/styles'; | ||
|
|
||
| import { getTextStyles } from '../shared/Text/textVariants'; | ||
|
|
||
| const defaultTextColor = getTextStyles().DEFAULT.color; | ||
|
|
||
| export const StyledCard = styled(Card)(({ theme, unavailable }) => ({ | ||
| width: '15rem', | ||
| height: '17rem', | ||
|
|
@@ -17,7 +21,7 @@ export const StyledCard = styled(Card)(({ theme, unavailable }) => ({ | |
| }, | ||
| })); | ||
|
|
||
| export const UnavailableOverlay = styled(Box)(({ theme }) => ({ | ||
| export const UnavailableOverlay = styled(Box)(() => ({ | ||
| position: 'absolute', | ||
| inset: 0, | ||
| zIndex: 2, | ||
|
|
@@ -30,7 +34,7 @@ export const UnavailableOverlay = styled(Box)(({ theme }) => ({ | |
|
|
||
| export const NotAvailableBadge = styled(Box)(({ theme }) => ({ | ||
| backgroundColor: theme.palette.disabledCard.background, | ||
| color: theme.palette.disabledCard.text, | ||
| color: defaultTextColor, | ||
| padding: `${theme.spacing(1 / 2)} ${theme.spacing(1)}`, | ||
|
Comment on lines
36
to
38
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there isnt a way to add color from pallete ? (following mui documentation) |
||
| borderRadius: '1.25rem', | ||
| fontWeight: theme.typography.fontWeightBold, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no use of Box and Divider, please remove