Skip to content

Commit

Permalink
Revert "feat: shippingList details porduct add notes https://bigc-b2b…
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianJiang2021 authored and libruce committed Dec 26, 2023
1 parent 12d5862 commit a66e9d0
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 233 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ReactElement } from 'react'
import { useB3Lang } from '@b3/lang'
import { Delete, Edit, StickyNote2 } from '@mui/icons-material'
import { Delete, Edit } from '@mui/icons-material'
import { Box, CardContent, styled, TextField, Typography } from '@mui/material'

import { PRODUCT_DEFAULT_IMAGE } from '@/constants'
Expand All @@ -24,9 +24,6 @@ interface ShoppingDetailCardProps {
len: number
itemIndex?: number
setDeleteOpen: (value: boolean) => void
setAddNoteItemId: (itemId: number) => void
setAddNoteOpen: (open: boolean) => void
setNotes: (value: string) => void
}

const StyledImage = styled('img')(() => ({
Expand All @@ -48,9 +45,6 @@ function ShoppingDetailCard(props: ShoppingDetailCardProps) {
len,
itemIndex,
setDeleteOpen,
setAddNoteOpen,
setAddNoteItemId,
setNotes,
} = props

const {
Expand All @@ -64,7 +58,6 @@ function ShoppingDetailCard(props: ShoppingDetailCardProps) {
productsSearch,
productUrl,
taxPrice = 0,
productNote,
} = shoppingDetail

const price = getBCPrice(+basePrice, +taxPrice)
Expand All @@ -83,8 +76,6 @@ function ShoppingDetailCard(props: ShoppingDetailCardProps) {
(item) => item.valueText
)

const canChangeOption = optionList.length > 0 && !isReadForApprove

return (
<Box
key={shoppingDetail.id}
Expand Down Expand Up @@ -155,19 +146,6 @@ function ShoppingDetailCard(props: ShoppingDetailCardProps) {
)}
</Box>

{productNote && productNote.trim().length > 0 && (
<Typography
sx={{
fontSize: '0.75rem',
color: '#ED6C02',
marginTop: '0.3rem',
marginBottom: '0.3rem',
}}
>
{productNote}
</Typography>
)}

<Typography
sx={{
color: '#212121',
Expand Down Expand Up @@ -226,26 +204,10 @@ function ShoppingDetailCard(props: ShoppingDetailCardProps) {
}}
id="shoppingList-actionList-mobile"
>
<StickyNote2
sx={{
marginRight: '0.5rem',
cursor: 'pointer',
color: 'rgba(0, 0, 0, 0.54)',
}}
onClick={() => {
setAddNoteOpen(true)
setAddNoteItemId(+itemId)

if (productNote) {
setNotes(productNote)
}
}}
/>
{canChangeOption && (
{optionList.length > 0 && !isReadForApprove && (
<Edit
sx={{
marginRight: canChangeOption ? '0.5rem' : '',
marginLeft: canChangeOption ? '0.3rem' : '',
marginRight: '0.5rem',
cursor: 'pointer',
color: 'rgba(0, 0, 0, 0.54)',
}}
Expand All @@ -257,7 +219,6 @@ function ShoppingDetailCard(props: ShoppingDetailCardProps) {
{!isReadForApprove && (
<Delete
sx={{
marginLeft: '0.3rem',
cursor: 'pointer',
color: 'rgba(0, 0, 0, 0.54)',
}}
Expand Down
Loading

0 comments on commit a66e9d0

Please sign in to comment.