Skip to content

Commit 43d4dfe

Browse files
chore: only show 'back button' on mobile (#134)
1 parent e88312f commit 43d4dfe

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

src/components/BackButton.tsx

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
import { ArrowLeft } from '@phosphor-icons/react'
22
import { useRouter } from 'next/navigation'
33

4+
import { useMobileScreens } from '@/hooks/use-mobile-screens'
5+
46
import { Button } from './ui'
57

68
export const BackButton = () => {
79
const router = useRouter()
10+
const { isSmallViewPort } = useMobileScreens()
811
return (
9-
<Button
10-
$background="none"
11-
$color="var(--color-black)"
12-
$width="6%"
13-
$alignItems="center"
14-
$gap="1rem"
15-
$padding="0"
16-
onClick={() => router.back()}
17-
>
18-
<ArrowLeft size={18} />
19-
</Button>
12+
isSmallViewPort && (
13+
<Button
14+
$background="none"
15+
$color="var(--color-black)"
16+
$width="6%"
17+
$alignItems="center"
18+
$gap="1rem"
19+
$padding="0"
20+
onClick={() => router.back()}
21+
>
22+
<ArrowLeft size={18} />
23+
</Button>
24+
)
2025
)
2126
}

0 commit comments

Comments
 (0)