Skip to content
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

Fix checkout header logo navigation #670

Merged
merged 6 commits into from
Aug 5, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ const App = (props) => {
</HideOnMobile>
</Header>
) : (
<CheckoutHeader />
<CheckoutHeader onLogoClick={onLogoClick} />
)}
</Box>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const Link = React.forwardRef(({href, to, useNavLink = false, ...props}, ref) =>
as={useNavLink ? NavSPALink : SPALink}
{...(useNavLink && {exact: true})}
{...props}
to={_href === '/' ? '/' : updatedHref}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

With multi-site implementation in place, the condition to keep '/' as is out of date. When the href is a '/', it should also be passed to buildUrl to generate the correct homepage url according to current site and locale

to={updatedHref}
ref={ref}
/>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import {Badge, Box, Button, Flex, Center} from '@chakra-ui/react'
import useBasket from '../../../commerce-api/hooks/useBasket'
import Link from '../../../components/link'
import {BasketIcon, BrandLogo} from '../../../components/icons'
import {HOME_HREF} from '../../../constants'

const CheckoutHeader = () => {
const basket = useBasket()

return (
<Box px={[4, 4, 8]} bg="white" borderBottom="1px" borderColor="gray.100">
<Box maxWidth="container.xxxl" marginLeft="auto" marginRight="auto">
<Flex h={{base: '52px', md: '80px'}} align="center" justify="space-between">
<Link href="/" title="Back to homepage">
<Link href={HOME_HREF} title="Back to homepage">
<BrandLogo
width={{base: '35px', md: '45px'}}
height={{base: '24px', md: '32px'}}
Expand Down