Skip to content

Commit

Permalink
fix: page flash
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianJiang2021 authored and kris-liu-smile committed Jun 27, 2023
1 parent 45742ee commit 9edb0b0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
3 changes: 3 additions & 0 deletions apps/storefront/src/components/RegisteredCloseButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Dispatch, SetStateAction, useContext } from 'react'
import { useNavigate } from 'react-router-dom'
import globalB3 from '@b3/global-b3'
import type { OpenPageState } from '@b3/hooks'
import { Box } from '@mui/material'
Expand All @@ -17,6 +18,7 @@ export default function RegisteredCloseButton(props: CloseButtonProps) {
const {
state: { isCheckout, isCloseGotoBCHome },
} = useContext(GlobaledContext)
const navigate = useNavigate()

const handleCloseForm = () => {
if (
Expand All @@ -25,6 +27,7 @@ export default function RegisteredCloseButton(props: CloseButtonProps) {
) {
window.location.href = '/'
} else {
navigate('/')
setOpenPage({
isOpen: false,
openUrl: '',
Expand Down
2 changes: 1 addition & 1 deletion apps/storefront/src/components/layout/B3Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export default function B3Layout({ children }: { children: ReactNode }) {
<B3Logo />
<Box
sx={{
pt: '40px',
pt: '24px',
}}
>
<B3Nav />
Expand Down
2 changes: 0 additions & 2 deletions apps/storefront/src/pages/login/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ export default function Login(props: RegisteredProps) {
{loginInfo.widgetHeadText && (
<LoginWidget
sx={{
bgcolor: '#D9D9D9',
mt: isMobile ? '20px' : '32px',
minHeight: '48px',
}}
Expand Down Expand Up @@ -345,7 +344,6 @@ export default function Login(props: RegisteredProps) {
{loginInfo.widgetFooterText && (
<LoginWidget
sx={{
bgcolor: '#D9D9D9',
mt: '20px',
minHeight: '48px',
}}
Expand Down
16 changes: 7 additions & 9 deletions apps/storefront/src/shared/routes/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,6 @@ export interface RouteFirstLevelItem extends RouteItemBasic {
}

const routes: RouteItem[] = [
{
path: '/',
name: '',
wsKey: 'router-orders',
isMenuItem: false,
component: HomePage,
permissions: [0, 1, 2, 3, 4, 99, 100],
isTokenLogin: true,
},
{
path: '/dashboard',
name: 'Dashboard',
Expand Down Expand Up @@ -221,6 +212,13 @@ const routes: RouteItem[] = [
]

const firstLevelRouting: RouteFirstLevelItem[] = [
{
path: '/',
name: '',
component: HomePage,
permissions: [0, 1, 2, 3, 4, 99, 100],
isProvider: false,
},
{
path: '/registered',
name: 'registered',
Expand Down

0 comments on commit 9edb0b0

Please sign in to comment.