Skip to content

Commit

Permalink
named export hook
Browse files Browse the repository at this point in the history
  • Loading branch information
pettinarip committed Jul 26, 2024
1 parent 572ab9e commit eba5968
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/Nav/Mobile/LvlAccordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const LvlAccordion = ({
<AccordionItem
key={label}
value={label}
className={cn("border-t border-body-light last:border-b")}
className="border-t border-body-light last:border-b"
>
<AccordionPrimitive.Trigger asChild>
{/* TODO: replace this with ButtonLink when is implemented */}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Nav/Mobile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import MenuBody from "./MenuBody"
import MenuFooter from "./MenuFooter"
import MenuHeader from "./MenuHeader"

import useDisclosure from "@/hooks/useDisclosure"
import { useDisclosure } from "@/hooks/useDisclosure"

type MobileNavMenuProps = ButtonProps & {
toggleColorMode: () => void
Expand Down
4 changes: 1 addition & 3 deletions src/hooks/useDisclosure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useBoolean } from "usehooks-ts"
* Hook that provides a more semantic API for managing the open/close state of a
* modal, dropdown, or any other component that can be opened and closed.
*/
function useDisclosure(defaultValue = false) {
export const useDisclosure = (defaultValue = false) => {
const { value, setTrue, setFalse, toggle } = useBoolean(defaultValue)

return {
Expand All @@ -14,5 +14,3 @@ function useDisclosure(defaultValue = false) {
onToggle: toggle,
}
}

export default useDisclosure

0 comments on commit eba5968

Please sign in to comment.