Skip to content

W-18672755 - W-18397045 - Chakra UI order history and order detail#2730

Merged
alexvuong merged 29 commits intofeature/chakra-ui-upgrade-v3from
chakra-ui-order-history
Jul 10, 2025
Merged

W-18672755 - W-18397045 - Chakra UI order history and order detail#2730
alexvuong merged 29 commits intofeature/chakra-ui-upgrade-v3from
chakra-ui-order-history

Conversation

@alexvuong
Copy link
Contributor

@alexvuong alexvuong commented Jul 4, 2025

Description

Order History
image

Order Detail
image

DNT modal
image

Types of Changes

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Breaking change (could cause existing functionality to not work as expected)
  • Other changes (non-breaking changes that does not fit any of the above)

Breaking changes include:

  • Removing a public function or component or prop
  • Adding a required argument to a function
  • Changing the data type of a function parameter or return value
  • Adding a new peer dependency to package.json

Changes

  • (change1)

How to Test-Drive This PR

  • Check out code
  • Run typescript minimal to load storefront
  • Log in
  • Go to account order and order history

Checklists

General

  • Changes are covered by test cases
  • CHANGELOG.md updated with a short description of changes (not required for documentation updates)

Accessibility Compliance

You must check off all items in one of the follow two lists:

  • There are no changes to UI

or...

Localization

  • Changes include a UI text update in the Retail React App (which requires translation)

@alexvuong alexvuong requested a review from a team as a code owner July 4, 2025 00:15
@cc-prodsec
Copy link
Collaborator

cc-prodsec commented Jul 4, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)


export default defineRecipe({
base: {
fontWeight: 'bold'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chakra v3 has changed default fontWeight from bold to semobold for all heading. We modified it here to match current design on pwa kit v3

<Popover.Header pb={1}>
<Popover.Title>
<Heading as="h2" fontWeight={700} size="lg">
<Heading as="h2" size="lg">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heading is now default to fontWeight: bold, no need to customise from the component

useNavLink={true}
to={`/account${link.path}`}
<List.Item key={link.name}>
<Button
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reapply Button to make use of current variant menu-link

<Button
asChild
variant="menu-link"
css={styles.menuAccountLink}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will allow customised style from parent and not affect all buttons of this variant

</Text>
<Badge colorScheme="green">{order.status}</Badge>
<Badge colorPalette="green" fontWeight="bold">
{order.status?.toUpperCase()}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Badge no longer bold and uppercase. https://www.chakra-ui.com/docs/components/badge

onMouseOver={isDesktop ? onAccountMenuOpen : noop}
>
<AccountIcon boxSize={6} />
<AccountIcon boxSize="6" />
Copy link
Contributor Author

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.

backgroundColor: 'white',
rounded: 'base',
boxShadow: 'base'
boxShadow: 'xs'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no 'base' for box shadown, replace with xs https://chakra-ui.com/docs/theming/shadows

fontWeight: 'semibold',
borderLeftWidth: '4px',
borderLeftStyle: 'solid',
borderLeftColor: 'transparent'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will help all items are align vertically when there is an active item. An active item will have a gray left border

@vcua-mobify
Copy link
Contributor

The chevron down on the account button for the header is off compared to the demo store

Screenshot 2025-07-04 at 4 02 38 PM

<AccountIcon boxSize={6} />
</IconButtonWithRegistration>
)}
<IconButtonWithRegistration
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am reverting the code we have for v3 because moving this icon into popover trigger causes the navigation to account onSuccessLogin failed.

paddingBottom: 1,
paddingLeft: [4, 4, 6, 6],
boxShadow: 'base'
boxShadow: 'sm'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chakra v3 does not have base for boxShadown anymore

import {defineSlotRecipe} from '@chakra-ui/react'

export default defineRecipe({
export default defineSlotRecipe({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Header is slotRecipe, I missed this when refactoring the header

isOpen={open}
onClose={onClose}
isOpen={isDrawerMenuOpen}
onClose={onDrawerMenuClose}
Copy link
Contributor

Choose a reason for hiding this comment

The 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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

const _inputProps =
typeof inputProps === 'function' ? inputProps({value, onChange}) : inputProps

const {endElement, ...restOfInputProps} = _inputProps || {}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will address the warning.

console.error
    Warning: React does not recognize the `endElement` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `endelement` instead. If you accidentally passed it from a parent component, remove it from the DOM element.

@vcua-mobify
Copy link
Contributor

The account drop down chevron is now in the expected location
Screenshot 2025-07-08 at 1 15 33 PM

Copy link
Contributor

@vcua-mobify vcua-mobify left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The order details, order history, and dnt banner all look good to me.

The account drop down now being an onClick is also working

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed a typo, it should be colorPalette="red"

_active={{background: 'gray.100'}}
_expanded={{background: 'transparent'}}
>
<Flex align="center" justify="center" width="full">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<Flex align="center" justify="center" width="full">
<Flex alignItems="center" justify="center" width="full">

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

align should still work, see here: https://www.chakra-ui.com/docs/components/flex#props

borderColor="gray.100"
borderRadius="base"
>
<Flex width="full" align="flex-start">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<Flex width="full" align="flex-start">
<Flex width="full" alignItems="flex-start">

@alexvuong alexvuong merged commit d0eeacd into feature/chakra-ui-upgrade-v3 Jul 10, 2025
4 checks passed
textDecorationColor: 'gray.900'
},
_activeLink: {
'&.active': {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad to see this method works!

alexvuong added a commit that referenced this pull request Jul 16, 2025
@alexvuong alexvuong deleted the chakra-ui-order-history branch July 16, 2025 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants