Skip to content

Commit 5ce82af

Browse files
committed
handle pathname and router support in sb
1 parent d1ab379 commit 5ce82af

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

src/components/FeedbackWidget/useFeedbackWidget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const useFeedbackWidget = () => {
3333
const pathsWithBottomNav = ["/staking", "/dao", "/defi", "/nft"]
3434
let shouldOffset = false
3535
pathsWithBottomNav.forEach((path) => {
36-
if (pathname.includes(path)) {
36+
if ((pathname || "").includes(path)) {
3737
shouldOffset = true
3838
}
3939
})

src/components/ui/Link.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const BaseLink = forwardRef<HTMLAnchorElement, LinkProps>(function Link(
5858
return <a {...props} />
5959
}
6060

61-
const isActive = url.isHrefActive(href, pathname, isPartiallyActive)
61+
const isActive = url.isHrefActive(href, pathname || "", isPartiallyActive)
6262
const isDiscordInvite = url.isDiscordInvite(href)
6363
const isFile = url.isFile(href)
6464
const isExternal = url.isExternal(href)

src/hooks/useSurvey.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ import { usePathname } from "@/i18n/routing"
1212
export const useSurvey = (feedbackSubmitted: boolean) => {
1313
const locale = useLocale()
1414
const pathname = usePathname()
15-
const { href: url } = new URL(path.join(locale! as Lang, pathname), SITE_URL)
15+
const { href: url } = new URL(
16+
path.join(locale! as Lang, pathname || ""),
17+
SITE_URL
18+
)
1619
return useMemo((): string | null => {
1720
if (!feedbackSubmitted) return null
1821
return `https://ethereumorg.paperform.co//?url=${url}`

src/layouts/stories/BaseLayout.stories.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ const meta = {
1515
...langViewportModes,
1616
},
1717
},
18+
nextjs: {
19+
appDirectory: true,
20+
},
1821
},
1922
argTypes: {
2023
children: {

0 commit comments

Comments
 (0)