@graphcommerce/next-ui 3.15.0 → 3.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,4 @@
1
- import {
2
- useHistoryLink,
3
- usePageContext,
4
- usePageRouter,
5
- usePrevUp,
6
- useUp,
7
- } from '@graphcommerce/framer-next-pages'
1
+ import { usePageContext, usePageRouter, usePrevUp, useUp } from '@graphcommerce/framer-next-pages'
8
2
  import { Fab, makeStyles, Theme } from '@material-ui/core'
9
3
  import clsx from 'clsx'
10
4
  import { m, MotionValue, useMotionValue, useTransform } from 'framer-motion'
@@ -250,10 +244,6 @@ export default function AppShellHeader(props: AppShellHeaderProps) {
250
244
  const titleOffset = useMotionValue<number>(100)
251
245
  const titleHeight = useMotionValue<number>(100)
252
246
 
253
- const { href: historyHref, onClick: historyOnClick } = useHistoryLink({
254
- href: up?.href ?? '',
255
- })
256
-
257
247
  const setOffset = useCallback(
258
248
  (offsetTop: number, offsetParent: Element | null, clientHeight: number) => {
259
249
  titleHeight.set(clientHeight)
@@ -339,18 +329,16 @@ export default function AppShellHeader(props: AppShellHeaderProps) {
339
329
 
340
330
  const canClickBack = backSteps > 0 && router.asPath !== prevUp?.href
341
331
  let back = canClickBack && (
342
- <PageLink href={historyHref} passHref>
343
- <Button
344
- onClick={historyOnClick}
345
- variant='pill-link'
346
- size='small'
347
- className={classes.backButton}
348
- startIcon={backIcon}
349
- aria-label='Back'
350
- >
351
- {historyOnClick ? up?.title : 'Back'}
352
- </Button>
353
- </PageLink>
332
+ <Button
333
+ onClick={() => router.back()}
334
+ variant='pill-link'
335
+ size='small'
336
+ className={classes.backButton}
337
+ startIcon={backIcon}
338
+ aria-label='Back'
339
+ >
340
+ {up?.href === router.asPath ? up?.title : 'Back'}
341
+ </Button>
354
342
  )
355
343
  if (!canClickBack && up?.href) {
356
344
  back = (
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.15.1](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.15.0...@graphcommerce/next-ui@3.15.1) (2021-11-11)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * better handling to go back from product page ([ff8e72b](https://github.com/ho-nl/m2-pwa/commit/ff8e72beef81b9fb0d20cbfbd50c282f0144aed7))
12
+
13
+
14
+
15
+
16
+
6
17
  # [3.15.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.14.8...@graphcommerce/next-ui@3.15.0) (2021-11-11)
7
18
 
8
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphcommerce/next-ui",
3
- "version": "3.15.0",
3
+ "version": "3.15.1",
4
4
  "author": "",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -53,5 +53,5 @@
53
53
  "project": "./tsconfig.json"
54
54
  }
55
55
  },
56
- "gitHead": "0d7e797850cec8d51ef8d88937a104aab6af4c35"
56
+ "gitHead": "9fb7a52af72eb5c9677f24e11d7b62871151c46e"
57
57
  }