-
Notifications
You must be signed in to change notification settings - Fork 212
W-18672755 - W-18397045 - Chakra UI order history and order detail #2730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 13 commits
0fba8c8
58a5946
5c11ae7
a753372
78fd619
e570c77
9484e4c
8fe2d25
3fd98c4
483bb8e
94055f0
9ce187a
4994899
accded0
cc033c2
6b5d9ed
db3edec
b939c68
d2b105a
5251e1c
c34d898
74c405c
90de11f
4291e2f
10538d4
1ed07c5
10ac07d
6f1ba24
2cd1e65
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -208,7 +208,7 @@ const Header = ({ | |
| onClick={onMyAccountClick} | ||
| onMouseOver={isDesktop ? onAccountMenuOpen : noop} | ||
| > | ||
| <AccountIcon boxSize={6} /> | ||
| <AccountIcon boxSize="6" /> | ||
| </IconButtonWithRegistration> | ||
| )} | ||
|
|
||
|
|
@@ -235,7 +235,7 @@ const Header = ({ | |
| ref={popoverTriggerRef} | ||
| onKeyDown={handleKeyDown} | ||
| > | ||
| <AccountIcon boxSize={6} onClick={onMyAccountClick} /> | ||
| <AccountIcon boxSize="6" onClick={onMyAccountClick} /> | ||
| <HideOnMobile> | ||
| <ChevronDownIcon /> | ||
| </HideOnMobile> | ||
|
|
@@ -257,15 +257,15 @@ const Header = ({ | |
| <Popover.Body css={styles.dropdownMenuBody}> | ||
| <Popover.Header pb={1}> | ||
| <Popover.Title> | ||
| <Heading as="h2" fontWeight={700} size="lg"> | ||
| <Heading as="h2" size="lg"> | ||
|
||
| {intl.formatMessage({ | ||
| defaultMessage: 'My Account', | ||
| id: 'header.popover.title.my_account' | ||
| })} | ||
| </Heading> | ||
| </Popover.Title> | ||
| </Popover.Header> | ||
| <Box asChild px={3}> | ||
| <Box asChild px="3"> | ||
| <nav> | ||
| <List.Root | ||
| variant="plain" | ||
|
|
@@ -275,40 +275,42 @@ const Header = ({ | |
| {navLinks.map((link) => { | ||
| const LinkIcon = link.icon | ||
| return ( | ||
| <List.Item | ||
| key={link.name} | ||
| value={link.name} | ||
| > | ||
| <Link | ||
| useNavLink={true} | ||
| to={`/account${link.path}`} | ||
| <List.Item key={link.name}> | ||
| <Button | ||
|
||
| asChild | ||
| variant="menu-link" | ||
| css={styles.menuAccountLink} | ||
|
||
| > | ||
| <LinkIcon | ||
| boxSize={5} | ||
| mr={3} | ||
| /> | ||
| {intl.formatMessage( | ||
| messages[link.name] | ||
| )} | ||
| </Link> | ||
| <Link | ||
| to={`/account${link.path}`} | ||
| useNavLink={true} | ||
| > | ||
| <LinkIcon | ||
| boxSize="5" | ||
| mr="2" | ||
| /> | ||
| {intl.formatMessage( | ||
| messages[link.name] | ||
| )} | ||
| </Link> | ||
| </Button> | ||
| </List.Item> | ||
| ) | ||
| })} | ||
| </List.Root> | ||
| </nav> | ||
| </Box> | ||
| <Separator mx={3} my={2} /> | ||
| <Separator mx="3" my="2" /> | ||
|
|
||
| <Popover.Footer px={3} py={0}> | ||
| <Popover.Footer px="3" py="0"> | ||
| <Button | ||
| variant="ghost" | ||
| css={styles.signoutButton} | ||
| onClick={onSignoutClick} | ||
| > | ||
| <SignoutIcon | ||
| aria-hidden={true} | ||
| boxSize={5} | ||
| boxSize="5" | ||
| css={styles.signoutIcon} | ||
| /> | ||
| <Text as="span" css={styles.signoutText}> | ||
|
|
@@ -335,7 +337,7 @@ const Header = ({ | |
| // uncomment when we fix wishlist | ||
| // onClick={onWishlistClick} | ||
| > | ||
| <HeartIcon boxSize={6} /> | ||
| <HeartIcon boxSize="6" /> | ||
| </IconButtonWithRegistration> | ||
| {isStoreLocatorEnabled && ( | ||
| <IconButton | ||
|
|
@@ -349,7 +351,7 @@ const Header = ({ | |
| openModal() | ||
| }} | ||
| > | ||
| <StoreIcon boxSize={6} /> | ||
| <StoreIcon boxSize="6" /> | ||
| </IconButton> | ||
| )} | ||
| <IconButton | ||
|
|
@@ -365,7 +367,7 @@ const Header = ({ | |
| onClick={onMyCartClick} | ||
| > | ||
| <> | ||
| <BasketIcon boxSize={6} /> | ||
| <BasketIcon boxSize="6" /> | ||
| {basket && totalItems > 0 && ( | ||
| <Badge variant="notification">{totalItems}</Badge> | ||
| )} | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I noticed a typo, it should be pwa-kit/packages/extension-chakra-storefront/src/components/order-summary/index.jsx Line 307 in d2b105a
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,8 @@ import { | |
| Flex, | ||
| Heading, | ||
| Spinner, | ||
|
|
||
| //hooks | ||
| useDisclosure, | ||
| useSlotRecipe, | ||
| useToken | ||
|
|
@@ -55,7 +57,7 @@ import {useExtensionConfig, useCurrentCustomer, useCurrentBasket} from '../../ho | |
| import {watchOnlineStatus, flatten} from '../../utils/utils' | ||
| import useActiveData from '../../hooks/use-active-data' | ||
| import useMultiSite from '../../hooks/use-multi-site' | ||
| // import {DntNotification, useDntNotification} from '../../hooks/use-dnt-notification' | ||
| import {DntNotification, useDntNotification} from '../../hooks/use-dnt-notification' | ||
|
|
||
| import {UserConfig} from '../../types/config' | ||
|
|
||
|
|
@@ -118,13 +120,17 @@ const withLayout = <P extends object>(WrappedComponent: React.ComponentType<P>) | |
| const history = useHistory() | ||
| const location = useLocation() | ||
| const authModal = useAuthModal() | ||
| // const dntNotification = useDntNotification() | ||
| const dntNotification = useDntNotification() | ||
| const {site, locale, buildUrl} = useMultiSite() | ||
| const [isOnline, setIsOnline] = useState<boolean>(true) | ||
|
|
||
| // https://www.chakra-ui.com/docs/theming/overview#tokens-1 | ||
| const [themeColor] = useToken('colors.blue', '600') | ||
| const {open, onOpen, onClose} = useDisclosure() | ||
| const { | ||
| open: isDrawerMenuOpen, | ||
| onOpen: onDrawerMenuOpen, | ||
| onClose: onDrawerMenuClose | ||
| } = useDisclosure() | ||
|
|
||
| // Used to conditionally render header/footer for checkout page | ||
| const isCheckout = /\/checkout$/.test(location?.pathname) | ||
|
|
@@ -179,7 +185,7 @@ const withLayout = <P extends object>(WrappedComponent: React.ComponentType<P>) | |
| useEffect(() => { | ||
| // Lets automatically close the mobile navigation when the | ||
| // location path is changed. | ||
| onClose() | ||
| onDrawerMenuClose() | ||
| }, [location]) | ||
|
|
||
| const onLogoClick = () => { | ||
|
|
@@ -191,15 +197,15 @@ const withLayout = <P extends object>(WrappedComponent: React.ComponentType<P>) | |
| history.push(path) | ||
|
|
||
| // Close the drawer. | ||
| onClose() | ||
| onDrawerMenuClose() | ||
| } | ||
|
|
||
| const onCartClick = () => { | ||
| const path = buildUrl('/cart', site.id, locale.id) | ||
| history.push(path) | ||
|
|
||
| // Close the drawer. | ||
| onClose() | ||
| onDrawerMenuClose() | ||
| } | ||
|
|
||
| const onAccountClick = () => { | ||
|
|
@@ -283,7 +289,7 @@ const withLayout = <P extends object>(WrappedComponent: React.ComponentType<P>) | |
| <> | ||
| <AboveHeader /> | ||
| <Header | ||
| onMenuClick={onOpen} | ||
| onMenuClick={onDrawerMenuOpen} | ||
| onLogoClick={onLogoClick} | ||
| onMyCartClick={onCartClick} | ||
| onMyAccountClick={onAccountClick} | ||
|
|
@@ -292,8 +298,8 @@ const withLayout = <P extends object>(WrappedComponent: React.ComponentType<P>) | |
| {/* TODO: mobile menu */} | ||
| <HideOnDesktop> | ||
| <DrawerMenu | ||
| isOpen={open} | ||
| onClose={onClose} | ||
| isOpen={isDrawerMenuOpen} | ||
| onClose={onDrawerMenuClose} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. open and onClose were set above so I think this part can remain unchanged?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I changed the name to make it clearer since we have a lot open/close state on the _app config. |
||
| onLogoClick={onLogoClick} | ||
| root={categories?.[CAT_MENU_DEFAULT_ROOT_CATEGORY]} | ||
| itemsKey="categories" | ||
|
|
@@ -343,7 +349,7 @@ const withLayout = <P extends object>(WrappedComponent: React.ComponentType<P>) | |
|
|
||
| {!isCheckout ? <Footer /> : <CheckoutFooter />} | ||
| <AuthModal {...(authModal as any)} /> | ||
| {/*<DntNotification {...dntNotification} />*/} | ||
| <DntNotification {...dntNotification} /> | ||
| </AddToCartModalProvider> | ||
| </Box> | ||
| {(config.activeDataEnabled as boolean) && ( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to use string instead of {} because the design token system is optimized to work with string values, ensuring more reliable processing by the styling engine.