Skip to content

Commit 572ab9e

Browse files
committed
remove temp button and use the new shadcn version
1 parent 9fef297 commit 572ab9e

File tree

5 files changed

+23
-8
lines changed

5 files changed

+23
-8
lines changed

src/components/Nav/Mobile/FooterButton.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { forwardRef } from "react"
22
import type { IconType } from "react-icons"
33

4-
import { Button, type ButtonProps } from "@/components/ui/button"
4+
import {
5+
Button,
6+
type ButtonProps,
7+
} from "../../../../tailwind/ui/buttons/Button"
58

69
type FooterButtonProps = ButtonProps & {
710
icon: IconType

src/components/Nav/Mobile/HamburgerButton.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ import { forwardRef } from "react"
22
import { motion } from "framer-motion"
33
import { useTranslation } from "next-i18next"
44

5-
import { Button, type ButtonProps } from "@/components/ui/button"
6-
75
import { HAMBURGER_BUTTON_ID } from "@/lib/constants"
86

7+
import {
8+
Button,
9+
type ButtonProps,
10+
} from "../../../../tailwind/ui/buttons/Button"
11+
912
const hamburgerSvg =
1013
"M 2 13 l 10 0 l 0 0 l 10 0 M 4 19 l 8 0 M 12 19 l 8 0 M 2 25 l 10 0 l 0 0 l 10 0"
1114
const glyphSvg =

src/components/Nav/Mobile/LvlAccordion.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@ import { useState } from "react"
22
import { useRouter } from "next/router"
33
import * as AccordionPrimitive from "@radix-ui/react-accordion"
44

5-
import { Button } from "@/components/ui/button"
6-
75
import { cn } from "@/lib/utils/cn"
86
import { trackCustomEvent } from "@/lib/utils/matomo"
97
import { cleanPath } from "@/lib/utils/url"
108

119
import { BaseLink } from "../../../../tailwind/Link"
10+
import { Button } from "../../../../tailwind/ui/buttons/Button"
1211
import type { Level, NavItem, NavSectionKey } from "../types"
1312

1413
import ExpandIcon from "./ExpandIcon"

src/components/Nav/Mobile/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { ButtonProps } from "@/components/ui/button"
21
import {
32
Sheet,
43
SheetContent,
@@ -7,6 +6,7 @@ import {
76
SheetTrigger,
87
} from "@/components/ui/sheet"
98

9+
import { ButtonProps } from "../../../../tailwind/ui/buttons/Button"
1010
import type { NavSections } from "../types"
1111

1212
import HamburgerButton from "./HamburgerButton"

src/components/ui/sheet.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,24 @@ import * as SheetPrimitive from "@radix-ui/react-dialog"
44

55
import { cn } from "@/lib/utils/cn"
66

7+
import { Button } from "../../../tailwind/ui/buttons/Button"
8+
79
const Sheet = SheetPrimitive.Root
810

911
const SheetTrigger = SheetPrimitive.Trigger
1012

11-
const SheetClose = SheetPrimitive.Close
12-
1313
const SheetPortal = SheetPrimitive.Portal
1414

15+
const SheetClose = React.forwardRef<
16+
React.ElementRef<typeof SheetPrimitive.Close>,
17+
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Close>
18+
>((props, ref) => (
19+
<SheetPrimitive.Close ref={ref} asChild>
20+
<Button variant="ghost" isSecondary {...props} />
21+
</SheetPrimitive.Close>
22+
))
23+
SheetClose.displayName = SheetPrimitive.Close.displayName
24+
1525
const SheetOverlay = React.forwardRef<
1626
React.ElementRef<typeof SheetPrimitive.Overlay>,
1727
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>

0 commit comments

Comments
 (0)