Skip to content

Commit

Permalink
fix: adjust account settings page & purchase products page loading
Browse files Browse the repository at this point in the history
  • Loading branch information
b3aton committed Mar 14, 2023
1 parent 12a4857 commit 415cc3f
Show file tree
Hide file tree
Showing 3 changed files with 169 additions and 165 deletions.
7 changes: 6 additions & 1 deletion apps/storefront/src/pages/accountSetting/AccountSetting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ const AccountSetting = () => {

const [accountSettings, setAccountSettings] = useState<any>({})

const [isVisible, setIsVisible] = useState<boolean>(false)

const companyId = role === 3 && isAgenting ? +salesRepCompanyId : +companyInfoId

const isBCUser = !isB2BUser || (role === 3 && !isAgenting)
Expand Down Expand Up @@ -276,6 +278,7 @@ const AccountSetting = () => {
B3SStorage.delete('isFinshUpdate')
}
setLoadding(false)
setIsVisible(true)
}
}

Expand Down Expand Up @@ -491,11 +494,12 @@ const AccountSetting = () => {
return (
<B3Sping
isSpinning={isloadding}
background="rgb(254, 249, 245)"
>
<Box
sx={{
width: `${isMobile ? '100%' : '35%'}`,
minHeight: '300px',
minHeight: `${isMobile ? '800px' : '300px'}`,
}}
>
<B3CustomForm
Expand All @@ -511,6 +515,7 @@ const AccountSetting = () => {
mt: '28px',
mb: `${isMobile ? '20px' : '0'}`,
width: '100%',
visibility: `${isVisible ? 'visible' : 'hidden'}`,
}}
onClick={handleAddUserClick}
variant="contained"
Expand Down
113 changes: 52 additions & 61 deletions apps/storefront/src/pages/quickorder/Quickorder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ import {
useMobile,
} from '@/hooks'

import {
B3Sping,
} from '@/components/spin/B3Sping'

import QuickorderTable from './components/QuickorderTable'
import QuickOrderFooter from './components/QuickOrderFooter'
import {
Expand All @@ -44,77 +40,72 @@ const Quickorder = () => {
const [checkedArr, setCheckedArr] = useState<CustomFieldItems>([])

return (
<B3Sping
isSpinning={isRequestLoading}
<Box
sx={{
width: '100%',
}}
>
<Box
sx={{
width: '100%',
display: 'flex',
justifyContent: 'center',
}}
>
<Box
<Grid
sx={{
display: 'flex',
justifyContent: 'center',
m: 0,
width: '100%',
}}
container
spacing={2}
>
<Grid
item
xs={isMobile ? 12 : 8}
sx={{
m: 0,
width: '100%',
backgroundColor: '#ffffff',
}}
container
spacing={2}
>

<Grid
item
xs={isMobile ? 12 : 8}
sx={{
backgroundColor: '#ffffff',
}}
>
<QuickorderTable
setCheckedArr={setCheckedArr}
setIsRequestLoading={setIsRequestLoading}
/>
</Grid>

<Grid
item
xs={isMobile ? 12 : 4}
sx={{
pt: !isMobile ? '0px !important' : '16px',
pl: isMobile ? '0px !important' : '16px',
}}
>
{
role !== 2 && (
<QuickOrderPad />
)
}
</Grid>
<QuickorderTable
setCheckedArr={setCheckedArr}
setIsRequestLoading={setIsRequestLoading}
isRequestLoading={isRequestLoading}
/>
</Grid>
</Box>
<Box
sx={{
position: 'fixed',
bottom: 0,
left: 0,
width: '100%',
zIndex: '999',
}}
>
<QuickOrderFooter
role={role}
checkedArr={checkedArr}
isAgenting={isAgenting}
setIsRequestLoading={setIsRequestLoading}
isB2BUser={isB2BUser}
/>
</Box>
<Grid
item
xs={isMobile ? 12 : 4}
sx={{
pt: !isMobile ? '0px !important' : '16px',
pl: isMobile ? '0px !important' : '16px',
}}
>
{
role !== 2 && (
<QuickOrderPad />
)
}
</Grid>
</Grid>
</Box>
<Box
sx={{
position: 'fixed',
bottom: 0,
left: 0,
width: '100%',
zIndex: '999',
}}
>
<QuickOrderFooter
role={role}
checkedArr={checkedArr}
isAgenting={isAgenting}
setIsRequestLoading={setIsRequestLoading}
isB2BUser={isB2BUser}
/>
</Box>
</B3Sping>
</Box>
)
}

Expand Down
Loading

0 comments on commit 415cc3f

Please sign in to comment.