Skip to content

Commit

Permalink
fix: update shopping list details style
Browse files Browse the repository at this point in the history
  • Loading branch information
b3aton committed Jan 6, 2023
1 parent 57789df commit 6b93818
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,11 @@ export const ReAddToCart = (props: ShoppingProductsProps) => {
{
newOptionList.length > 0 && optionsValue.length > 0 && optionsValue.map((option: CustomFieldItems) => (
<Typography
variant="body1"
color="#616161"
sx={{
fontSize: '0.75rem',
lineHeight: '1.5',
color: '#455A64',
}}
key={option.valueLabel}
>
{`${option.valueLabel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,18 @@ const ShoppingDetailCard = (props: ShoppingDetailCardProps) => {
flex: 1,
}}
>
<Typography>{productName}</Typography>
<Typography>{variantSku}</Typography>
<Typography
variant="body1"
color="#212121"
>
{productName}
</Typography>
<Typography
variant="body1"
color="#616161"
>
{variantSku}
</Typography>
<Box
sx={{
margin: '1rem 0',
Expand All @@ -123,7 +133,14 @@ const ShoppingDetailCard = (props: ShoppingDetailCardProps) => {
<Box>
{
optionsValue.map((option: any) => (
<Typography key={option.valueLabel}>
<Typography
sx={{
fontSize: '0.75rem',
lineHeight: '1.5',
color: '#455A64',
}}
key={option.valueLabel}
>
{`${option.valueLabel
}: ${option.valueText}`}
</Typography>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ const ShoppingDetailFooter = (props: ShoppingDetailFooterProps) => {
skus.push(node.variantSku)
})

if (skus.length === 0) {
snackbar.error('Please select at least one item to add to cart')
return
}

const getInventoryInfos = await getB2BVariantInfoBySkus({
skus,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,14 +331,31 @@ const ShoppingDetailTable = (props: ShoppingDetailTableProps, ref: Ref<unknown>)
loading="lazy"
/>
<Box>
<Typography>{row.productName}</Typography>
<Typography>{row.variantSku}</Typography>
<Typography
variant="body1"
color="#212121"
>
{row.productName}
</Typography>
<Typography
variant="body1"
color="#616161"
>
{row.variantSku}
</Typography>
{
(optionList.length > 0 && optionsValue.length > 0) && (
<Box>
{
optionsValue.map((option: any) => (
<Typography key={option.valueLabel}>
<Typography
sx={{
fontSize: '0.75rem',
lineHeight: '1.5',
color: '#455A64',
}}
key={option.valueLabel}
>
{`${option.valueLabel
}: ${option.valueText}`}
</Typography>
Expand Down

0 comments on commit 6b93818

Please sign in to comment.