Skip to content

Commit

Permalink
feat: buy again quick order page
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianJiang2021 committed Feb 22, 2023
1 parent 2877141 commit ca2e6c5
Show file tree
Hide file tree
Showing 9 changed files with 1,252 additions and 108 deletions.
1 change: 0 additions & 1 deletion apps/storefront/src/components/B3StoreContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export const B3StoreContainer = (props: B3StoreContainerProps) => {

useLayoutEffect(() => {
const getStoreBasicInfo = async () => {
console.log(window.location.hash, '2323')
if (window.location.pathname.includes('account.php') || window.location.hash) {
showPageMask(true)
}
Expand Down
2 changes: 1 addition & 1 deletion apps/storefront/src/components/ui/B3Picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
interface B3PickerProps {
onChange: (date: Date | string | number) => void;
variant?: 'filled' | 'outlined' | 'standard';
value: Date | string | number;
value: Date | string | number | undefined;
label: string;
disableOpenPicker?: boolean;
formatInput?: string
Expand Down
38 changes: 19 additions & 19 deletions apps/storefront/src/pages/quickorder/Quickorder.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
useState,
useRef,
useEffect,
} from 'react'

Expand All @@ -18,10 +17,10 @@ import {
} from '@/components/spin/B3Sping'

import QuickorderTable from './components/QuickorderTable'

interface TableRefProps extends HTMLInputElement {
getCheckedList: () => CustomFieldItems,
}
import QuickOrderFooter from './components/QuickOrderFooter'
import {
QuickOrderPad,
} from './components/QuickOrderPad'

const Quickorder = () => {
useEffect(() => {
Expand All @@ -30,14 +29,7 @@ const Quickorder = () => {
const [isMobile] = useMobile()

const [isRequestLoading, setIsRequestLoading] = useState<boolean>(false)

const tableRef = useRef<TableRefProps>(null)

const getCheckedList = () => {
const checkedValue = tableRef.current?.getCheckedList()

console.log(checkedValue)
}
const [checkedArr, setCheckedArr] = useState<CustomFieldItems>([])

return (
<B3Sping
Expand All @@ -63,15 +55,21 @@ const Quickorder = () => {
spacing={2}
>

<Grid xs={isMobile ? 12 : 8}>
<Grid
item
xs={isMobile ? 12 : 8}
>
<QuickorderTable
setCheckedArr={setCheckedArr}
setIsRequestLoading={setIsRequestLoading}
ref={tableRef}
/>
</Grid>

<Grid xs={isMobile ? 12 : 4}>
sidebar
<Grid
item
xs={isMobile ? 12 : 4}
>
<QuickOrderPad />
</Grid>
</Grid>
</Box>
Expand All @@ -82,9 +80,11 @@ const Quickorder = () => {
left: 0,
width: '100%',
}}
onClick={getCheckedList}
>
button
<QuickOrderFooter
checkedArr={checkedArr}
setIsRequestLoading={setIsRequestLoading}
/>
</Box>
</Box>
</B3Sping>
Expand Down
Loading

0 comments on commit ca2e6c5

Please sign in to comment.