Skip to content

Commit

Permalink
Merge pull request #2398 from graphcommerce-org/fix/GCOM-1490-2
Browse files Browse the repository at this point in the history
refactor: exclude ‘disableBackNavigation’ prop from LinkOrButton in LayoutHeaderBack
  • Loading branch information
paales authored Oct 30, 2024
2 parents c0b8362 + 557171b commit 3cf66ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/purple-suns-unite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcommerce/next-ui': patch
---

Exclude ‘disableBackNavigation’ prop from LinkOrButton in LayoutHeaderBack.
6 changes: 3 additions & 3 deletions packages/next-ui/Layout/components/LayoutHeaderBack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const buttonSx: SxProps<Theme> = (theme) => ({
})

export function LayoutHeaderBack(props: BackProps) {
const { disableBackNavigation = false } = props
const { disableBackNavigation = false, ...rest } = props
const router = useRouter()
const path = router.asPath.split('?')[0]
const up = useUp()
Expand All @@ -68,7 +68,7 @@ export function LayoutHeaderBack(props: BackProps) {
color='inherit'
startIcon={backIcon}
aria-label={label}
{...props}
{...rest}
>
<Box component='span' sx={{ display: { xs: 'none', md: 'inline' } }}>
{label}
Expand All @@ -85,7 +85,7 @@ export function LayoutHeaderBack(props: BackProps) {
startIcon={backIcon}
aria-label={up.title}
color='inherit'
{...props}
{...rest}
>
<Box component='span' sx={{ display: { xs: 'none', md: 'inline' } }}>
{up.title}
Expand Down

0 comments on commit 3cf66ff

Please sign in to comment.