Skip to content

Commit

Permalink
feat: update order details style
Browse files Browse the repository at this point in the history
  • Loading branch information
b3aton authored and kris-liu-smile committed Nov 22, 2022
1 parent bcf9383 commit 26fed9b
Showing 1 changed file with 9 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
Typography,
Checkbox,
TextField,
FormControlLabel,
} from '@mui/material'

import {
Expand Down Expand Up @@ -34,7 +33,8 @@ interface FlexProps {

interface FlexItemProps {
width?: string,
padding?: string
padding?: string,
flexBasis?: string,
}

const Flex = styled('div')(({
Expand Down Expand Up @@ -73,11 +73,13 @@ const Flex = styled('div')(({
const FlexItem = styled('div')(({
width,
padding = '0',
flexBasis,
}: FlexItemProps) => ({
display: 'flex',
flexGrow: width ? 0 : 1,
flexShrink: width ? 0 : 1,
alignItems: 'flex-start',
flexBasis,
width,
padding,
}))
Expand Down Expand Up @@ -112,11 +114,11 @@ const defaultItemStyle = {
const mobileItemStyle = {
default: {
width: '100%',
padding: '0 0 0 76px',
padding: '0 0 0 128px',
},
qty: {
width: '100%',
padding: '0 0 0 76px',
padding: '0 0 0 128px',
},
}

Expand Down Expand Up @@ -170,20 +172,6 @@ export const OrderCheckboxProduct = (props: OrderCheckboxProductProps) => {

return products.length > 0 ? (
<Box>
<Box sx={{
padding: '0 11px',
}}
>
<FormControlLabel
control={(
<Checkbox
checked={list.length === products.length}
onChange={handleSelectAllChange}
/>
)}
label="Select all products"
/>
</Box>
{
!isMobile && (
<Flex
Expand All @@ -194,7 +182,7 @@ export const OrderCheckboxProduct = (props: OrderCheckboxProductProps) => {
checked={list.length === products.length}
onChange={handleSelectAllChange}
/>
<FlexItem>
<FlexItem flexBasis="100px">
<ProductHead>Product</ProductHead>
</FlexItem>
<FlexItem {...itemStyle.default}>
Expand Down Expand Up @@ -223,7 +211,7 @@ export const OrderCheckboxProduct = (props: OrderCheckboxProductProps) => {
checked={isChecked(product.variant_id)}
onChange={() => handleSelectChange(product.variant_id)}
/>
<FlexItem>
<FlexItem flexBasis="100px">
<ProductImage src={product.imageUrl} />
<Box
sx={{
Expand Down Expand Up @@ -259,7 +247,7 @@ export const OrderCheckboxProduct = (props: OrderCheckboxProductProps) => {
value={getProductQuantity(product)}
size="small"
sx={{
width: isMobile ? '50%' : '100%',
width: isMobile ? '60%' : '100%',
}}
/>
</FlexItem>
Expand Down

0 comments on commit 26fed9b

Please sign in to comment.