Skip to content

Commit

Permalink
remove temp button and use the new shadcn version
Browse files Browse the repository at this point in the history
  • Loading branch information
pettinarip committed Jul 25, 2024
1 parent 9fef297 commit 572ab9e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 8 deletions.
5 changes: 4 additions & 1 deletion src/components/Nav/Mobile/FooterButton.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { forwardRef } from "react"
import type { IconType } from "react-icons"

import { Button, type ButtonProps } from "@/components/ui/button"
import {
Button,
type ButtonProps,
} from "../../../../tailwind/ui/buttons/Button"

type FooterButtonProps = ButtonProps & {
icon: IconType
Expand Down
7 changes: 5 additions & 2 deletions src/components/Nav/Mobile/HamburgerButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ import { forwardRef } from "react"
import { motion } from "framer-motion"
import { useTranslation } from "next-i18next"

import { Button, type ButtonProps } from "@/components/ui/button"

import { HAMBURGER_BUTTON_ID } from "@/lib/constants"

import {
Button,
type ButtonProps,
} from "../../../../tailwind/ui/buttons/Button"

const hamburgerSvg =
"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"
const glyphSvg =
Expand Down
3 changes: 1 addition & 2 deletions src/components/Nav/Mobile/LvlAccordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ import { useState } from "react"
import { useRouter } from "next/router"
import * as AccordionPrimitive from "@radix-ui/react-accordion"

import { Button } from "@/components/ui/button"

import { cn } from "@/lib/utils/cn"
import { trackCustomEvent } from "@/lib/utils/matomo"
import { cleanPath } from "@/lib/utils/url"

import { BaseLink } from "../../../../tailwind/Link"
import { Button } from "../../../../tailwind/ui/buttons/Button"
import type { Level, NavItem, NavSectionKey } from "../types"

import ExpandIcon from "./ExpandIcon"
Expand Down
2 changes: 1 addition & 1 deletion src/components/Nav/Mobile/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { ButtonProps } from "@/components/ui/button"
import {
Sheet,
SheetContent,
Expand All @@ -7,6 +6,7 @@ import {
SheetTrigger,
} from "@/components/ui/sheet"

import { ButtonProps } from "../../../../tailwind/ui/buttons/Button"
import type { NavSections } from "../types"

import HamburgerButton from "./HamburgerButton"
Expand Down
14 changes: 12 additions & 2 deletions src/components/ui/sheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,24 @@ import * as SheetPrimitive from "@radix-ui/react-dialog"

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

import { Button } from "../../../tailwind/ui/buttons/Button"

const Sheet = SheetPrimitive.Root

const SheetTrigger = SheetPrimitive.Trigger

const SheetClose = SheetPrimitive.Close

const SheetPortal = SheetPrimitive.Portal

const SheetClose = React.forwardRef<
React.ElementRef<typeof SheetPrimitive.Close>,
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Close>
>((props, ref) => (
<SheetPrimitive.Close ref={ref} asChild>
<Button variant="ghost" isSecondary {...props} />
</SheetPrimitive.Close>
))
SheetClose.displayName = SheetPrimitive.Close.displayName

const SheetOverlay = React.forwardRef<
React.ElementRef<typeof SheetPrimitive.Overlay>,
React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>
Expand Down

0 comments on commit 572ab9e

Please sign in to comment.