Client fetching
diff --git a/app/(transition)/graphiql/page.tsx b/app/(transition)/graphiql/page.tsx
index f6700cc..814db77 100644
--- a/app/(transition)/graphiql/page.tsx
+++ b/app/(transition)/graphiql/page.tsx
@@ -110,7 +110,7 @@ export default function Pregunta() {
}
setIsLoggedIn(true);
const fetcher = createGraphiQLFetcher({
- url: process.env.NEXT_PUBLIC_GRAPHQL_ENDPOINT!,
+ url: process.env.NEXT_PUBLIC_JSCL_API_URL!,
enableIncrementalDelivery: true,
fetch(input, init) {
return fetch(input, {
@@ -149,7 +149,7 @@ export default function Pregunta() {
}
return (
{
cache: new InMemoryCache(),
link: new HttpLink({
// this needs to be an absolute url, as relative urls cannot be used in SSR
- uri: process.env.NEXT_PUBLIC_GRAPHQL_ENDPOINT,
+ uri: process.env.NEXT_PUBLIC_JSCL_API_URL,
+ fetch,
// you can disable result caching here if you want to
// (this does not work if you are rendering your page with `export const dynamic = "force-static"`)
// fetchOptions: { cache: "no-store" },
diff --git a/src/api/ApolloWrapper.tsx b/src/api/ApolloWrapper.tsx
index 7685364..6d607be 100644
--- a/src/api/ApolloWrapper.tsx
+++ b/src/api/ApolloWrapper.tsx
@@ -10,7 +10,7 @@ import {
function makeClient() {
const httpLink = new HttpLink({
// this needs to be an absolute url, as relative urls cannot be used in SSR
- uri: process.env.NEXT_PUBLIC_GRAPHQL_ENDPOINT,
+ uri: process.env.NEXT_PUBLIC_JSCL_API_URL,
// you can disable result caching here if you want to
// (this does not work if you are rendering your page with `export const dynamic = "force-static"`)
fetchOptions: { cache: "no-store" },
diff --git a/src/components/Navbar/MainNav.tsx b/src/components/Navbar/MainNav.tsx
index 92c2ce8..cefc9ce 100644
--- a/src/components/Navbar/MainNav.tsx
+++ b/src/components/Navbar/MainNav.tsx
@@ -1,13 +1,48 @@
import { NavBarProps } from "./types";
import { NavbarItem } from "./NavbarItem";
+import {
+ SignInButton,
+ SignOutButton,
+ SignedIn,
+ SignedOut,
+} from "@clerk/clerk-react";
+import { Button } from "../ui/button";
+import { usePathname } from "next/navigation";
+import { useEffect, useState } from "react";
export function MainNav({ items }: NavBarProps) {
+ const pathname = usePathname();
+ const [redirectUrl, setRedirectUrl] = useState("");
+ useEffect(() => {
+ setRedirectUrl(window.location.host);
+ }, []);
return (
-
+
{items.map((item) => (
))}
+
+ {process.env.NEXT_PUBLIC_SIGN_IN_URL ? (
+
+
+ Ingresar
+
+
+ ) : (
+
+ Ingresar
+
+ )}
+
+
+
+
+ Salir
+
+
+
);
}
diff --git a/src/components/Navbar/MobileLink.tsx b/src/components/Navbar/MobileLink.tsx
index 1c6f736..bd18111 100644
--- a/src/components/Navbar/MobileLink.tsx
+++ b/src/components/Navbar/MobileLink.tsx
@@ -1,4 +1,3 @@
-
import { useRouter } from "next/navigation";
import Link, { LinkProps } from "next/link";
import classNames from "classnames";
diff --git a/src/components/Navbar/MobileNav.tsx b/src/components/Navbar/MobileNav.tsx
index cf2ba41..37aace6 100644
--- a/src/components/Navbar/MobileNav.tsx
+++ b/src/components/Navbar/MobileNav.tsx
@@ -9,9 +9,22 @@ import { NavBarProps } from "./types";
import { MobileNavbarItem } from "./MobileNavbarItem";
import { MobileLink } from "./MobileLink";
import { Menu, PackageOpen } from "lucide-react";
+import {
+ SignInButton,
+ SignOutButton,
+ SignedIn,
+ SignedOut,
+} from "@clerk/clerk-react";
+import { usePathname } from "next/navigation";
+import { useEffect, useState } from "react";
export function MobileNav({ items }: NavBarProps) {
- const [open, setOpen] = React.useState(false);
+ const [open, setOpen] = useState(false);
+ const pathname = usePathname();
+ const [redirectUrl, setRedirectUrl] = useState("");
+ useEffect(() => {
+ setRedirectUrl(window.location.host);
+ }, []);
return (
@@ -32,12 +45,47 @@ export function MobileNav({ items }: NavBarProps) {
>
-
+
{items.map((item) => (
-
+
))}
+
+ {process.env.NEXT_PUBLIC_SIGN_IN_URL ? (
+
+
+ Ingresar
+
+
+ ) : (
+
+ setOpen(false)}>
+ Ingresar
+
+
+ )}
+
+
+
+ {
+ setOpen(false);
+ }}
+ // item={{ link: "#", content: "Salir" }}
+ // setOpen={setOpen}
+ >
+ Salir
+
+
+
diff --git a/src/components/Navbar/MobileNavbarItem.tsx b/src/components/Navbar/MobileNavbarItem.tsx
index f06d773..6ef0428 100644
--- a/src/components/Navbar/MobileNavbarItem.tsx
+++ b/src/components/Navbar/MobileNavbarItem.tsx
@@ -25,11 +25,20 @@ export const MobileNavbarItem = ({
}
if (item.onClick) {
- return {item.content}
+ return (
+
+ {item.content}
+
+ );
}
- return {item.content}
- }
+ return (
+ {item.content}
+ );
+ };
if (item.children) {
return (
diff --git a/src/components/Navbar/NavbarItem.tsx b/src/components/Navbar/NavbarItem.tsx
index 899c9dc..b484f3c 100644
--- a/src/components/Navbar/NavbarItem.tsx
+++ b/src/components/Navbar/NavbarItem.tsx
@@ -6,7 +6,6 @@ import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
- DropdownMenuLabel,
DropdownMenuTrigger,
DropdownMenuSeparator,
} from "@/components/ui/dropdown-menu";
@@ -16,14 +15,17 @@ export const NavbarItem = ({ item }: { item: NavbarMenuItem }) => {
if (item.children) {
return (
-
+
{item.content}
- {item.children.map((children) => {
+ {item?.children?.map((children) => {
if (children.link) {
return (
-
+
{children.icon}
{children.content}
@@ -36,7 +38,11 @@ export const NavbarItem = ({ item }: { item: NavbarMenuItem }) => {
return ;
}
return (
-
+
{children.icon}
{children.content}
@@ -55,10 +61,18 @@ export const NavbarItem = ({ item }: { item: NavbarMenuItem }) => {
>
{item.content}
- )
+ );
}
- return
- {item.content}
-
+ return (
+
+ {item.content}
+
+ );
};
diff --git a/src/components/Navbar/ThemeSwitcher.tsx b/src/components/Navbar/ThemeSwitcher.tsx
index e773112..b6ee497 100644
--- a/src/components/Navbar/ThemeSwitcher.tsx
+++ b/src/components/Navbar/ThemeSwitcher.tsx
@@ -1,31 +1,33 @@
-"use client"
+"use client";
-import * as React from "react"
-import { Moon, Sun } from "lucide-react"
-import { useTheme } from "next-themes"
+import * as React from "react";
+import { Moon, Sun } from "lucide-react";
+import { useTheme } from "next-themes";
-import { Button } from "@/components/ui/button"
+import { Button } from "@/components/ui/button";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
-} from "@/components/ui/dropdown-menu"
+} from "@/components/ui/dropdown-menu";
export function ThemeSwitcher() {
- const { setTheme } = useTheme()
- const themes = [{
- name: 'Light',
- type: 'light'
- },
- {
- name: 'Dark',
- type: 'dark',
- },
- {
- name: 'System',
- type: 'system'
- }];
+ const { setTheme } = useTheme();
+ const themes = [
+ {
+ name: "Light",
+ type: "light",
+ },
+ {
+ name: "Dark",
+ type: "dark",
+ },
+ {
+ name: "System",
+ type: "system",
+ },
+ ];
return (
@@ -37,10 +39,16 @@ export function ThemeSwitcher() {
- {themes.map(({ name, type }) => setTheme(type)}>
- {name}
- )}
+ {themes.map(({ name, type }) => (
+ setTheme(type)}
+ >
+ {name}
+
+ ))}
-
- )
-}
\ No newline at end of file
+
+ );
+}
diff --git a/src/components/Navbar/types.d.ts b/src/components/Navbar/types.d.ts
index 2d17807..87c07bd 100644
--- a/src/components/Navbar/types.d.ts
+++ b/src/components/Navbar/types.d.ts
@@ -1,13 +1,13 @@
+import { DropdownMenuSeparatorProps } from "@radix-ui/react-dropdown-menu";
export type NavbarMenuItem = {
- content: string;
- link?: string;
- icon?: React.ReactNode;
- onClick?: (e: React.MouseEvent) => void;
- children?: Array;
-}
+ content: string;
+ link?: string;
+ icon?: React.ReactNode;
+ onClick?: (e: React.MouseEvent) => void;
+ children?: Array;
+};
export type NavBarProps = {
- items: Array;
-}
-
+ items: Array;
+};
diff --git a/src/components/PageTransition.tsx b/src/components/PageTransition.tsx
index 2105bda..aefa892 100644
--- a/src/components/PageTransition.tsx
+++ b/src/components/PageTransition.tsx
@@ -17,7 +17,7 @@ const transition = {
function PageTransition(
{ children, ...rest }: PageTransitionProps,
- ref: PageTransitionRef
+ ref: PageTransitionRef,
) {
return (
{children}
diff --git a/src/components/nav.tsx b/src/components/nav.tsx
index 427325a..61f38bc 100644
--- a/src/components/nav.tsx
+++ b/src/components/nav.tsx
@@ -7,6 +7,7 @@ import { ThemeSwitcher } from "./Navbar/ThemeSwitcher";
import { LogOut, Settings, User, PackageOpen } from "lucide-react";
import { useClerk, useUser } from "@clerk/clerk-react";
import { useMemo } from "react";
+import { NavbarMenuItem } from "./Navbar/types";
export const Nav = () => {
const { isLoaded, isSignedIn } = useUser();
@@ -14,70 +15,64 @@ export const Nav = () => {
const { signOut } = useClerk();
const guestItems = useMemo(
- () => [
- {
- content: "Eventos",
- link: "/",
- },
- {
- content: "Comunidades",
- link: "/",
- },
- {
- content: "Login",
- link: "/sign-in",
- },
- {
- content: "Regístrate",
- link: "/sign-up",
- },
- ],
+ () =>
+ [
+ {
+ content: "Eventos",
+ link: "/",
+ },
+ {
+ content: "Comunidades",
+ link: "/",
+ },
+ ] satisfies NavbarMenuItem[],
[],
);
const userItems = useMemo(
- () => [
- {
- content: "Eventos",
- link: "/",
- },
- {
- content: "Comunidades",
- link: "/",
- },
- {
- content: "Perfil",
- children: [
- {
- content: "Mi Cuenta",
- icon: ,
- link: "/",
- },
- {
- content: "separator",
- },
- {
- content: "Settings",
- icon: ,
- link: "/",
- },
- {
- content: "separator",
- },
- {
- content: "Salir",
- icon: ,
- onClick: () => {
- const key = process.env.NEXT_PUBLIC_TOKEN_STORAGE_KEY;
- if (key) {
- window.localStorage.clear();
- }
- return signOut();
+ () =>
+ [
+ {
+ content: "Eventos",
+ link: "/",
+ },
+ {
+ content: "Comunidades",
+ link: "/",
+ },
+ {
+ content: "Perfil",
+ children: [
+ {
+ content: "Mi Cuenta",
+ icon: ,
+ link: "/",
},
- },
- ],
- },
- ],
+ {
+ content: "separator",
+ },
+ {
+ content: "Settings",
+ icon: ,
+ link: "/",
+ },
+ {
+ content: "separator",
+ },
+ {
+ content: "Salir",
+ icon: ,
+ onClick: () => {
+ const key = process.env.NEXT_PUBLIC_TOKEN_STORAGE_KEY;
+ if (key) {
+ window.localStorage.clear();
+ }
+ signOut().catch((e) => console.error(e));
+ },
+ },
+ ],
+ },
+ ] satisfies NavbarMenuItem[],
[signOut],
);
@@ -92,7 +87,7 @@ export const Nav = () => {
-
+
diff --git a/src/components/providers.tsx b/src/components/providers.tsx
index 12dc89e..b4e8e4f 100644
--- a/src/components/providers.tsx
+++ b/src/components/providers.tsx
@@ -1,13 +1,9 @@
-"use client"
+"use client";
-import * as React from "react"
-import { ThemeProvider as NextThemesProvider } from "next-themes"
-import { ThemeProviderProps } from "next-themes/dist/types"
+import * as React from "react";
+import { ThemeProvider as NextThemesProvider } from "next-themes";
+import { ThemeProviderProps } from "next-themes/dist/types";
export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
- return (
-
- {children}
-
- )
-}
\ No newline at end of file
+ return {children} ;
+}
diff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsx
index ac8e0c9..29123a7 100644
--- a/src/components/ui/button.tsx
+++ b/src/components/ui/button.tsx
@@ -1,8 +1,8 @@
-import * as React from "react"
-import { Slot } from "@radix-ui/react-slot"
-import { cva, type VariantProps } from "class-variance-authority"
+import * as React from "react";
+import { Slot } from "@radix-ui/react-slot";
+import { cva, type VariantProps } from "class-variance-authority";
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
const buttonVariants = cva(
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
@@ -30,27 +30,27 @@ const buttonVariants = cva(
variant: "default",
size: "default",
},
- }
-)
+ },
+);
export interface ButtonProps
extends React.ButtonHTMLAttributes,
VariantProps {
- asChild?: boolean
+ asChild?: boolean;
}
const Button = React.forwardRef(
({ className, variant, size, asChild = false, ...props }, ref) => {
- const Comp = asChild ? Slot : "button"
+ const Comp = asChild ? Slot : "button";
return (
- )
- }
-)
-Button.displayName = "Button"
+ );
+ },
+);
+Button.displayName = "Button";
-export { Button, buttonVariants }
+export { Button, buttonVariants };
diff --git a/src/components/ui/dropdown-menu.tsx b/src/components/ui/dropdown-menu.tsx
index f69a0d6..2ba6f48 100644
--- a/src/components/ui/dropdown-menu.tsx
+++ b/src/components/ui/dropdown-menu.tsx
@@ -1,27 +1,28 @@
-"use client"
+"use client";
-import * as React from "react"
-import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
-import { Check, ChevronRight, Circle } from "lucide-react"
+import * as React from "react";
+import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
+import { Check, ChevronRight, Circle } from "lucide-react";
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
-const DropdownMenu = DropdownMenuPrimitive.Root
+const DropdownMenu = DropdownMenuPrimitive.Root;
-const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger
+const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
-const DropdownMenuGroup = DropdownMenuPrimitive.Group
+const DropdownMenuGroup = DropdownMenuPrimitive.Group;
-const DropdownMenuPortal = DropdownMenuPrimitive.Portal
+const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
-const DropdownMenuSub = DropdownMenuPrimitive.Sub
+const DropdownMenuSub = DropdownMenuPrimitive.Sub;
-const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup
+const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
const DropdownMenuSubTrigger = React.forwardRef<
React.ElementRef,
React.ComponentPropsWithoutRef & {
- inset?: boolean
+ inset?: boolean;
+ className?: string;
}
>(({ className, inset, children, ...props }, ref) => (
{children}
-))
+));
DropdownMenuSubTrigger.displayName =
- DropdownMenuPrimitive.SubTrigger.displayName
+ DropdownMenuPrimitive.SubTrigger.displayName;
const DropdownMenuSubContent = React.forwardRef<
React.ElementRef,
- React.ComponentPropsWithoutRef
+ React.ComponentPropsWithoutRef & {
+ className?: string;
+ }
>(({ className, ...props }, ref) => (
-))
+));
DropdownMenuSubContent.displayName =
- DropdownMenuPrimitive.SubContent.displayName
+ DropdownMenuPrimitive.SubContent.displayName;
const DropdownMenuContent = React.forwardRef<
React.ElementRef,
- React.ComponentPropsWithoutRef
+ React.ComponentPropsWithoutRef & {
+ sideOffset?: number;
+ className?: string;
+ }
>(({ className, sideOffset = 4, ...props }, ref) => (
-))
-DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName
+));
+DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
const DropdownMenuItem = React.forwardRef<
React.ElementRef,
React.ComponentPropsWithoutRef & {
- inset?: boolean
+ inset?: boolean;
+ className?: string;
}
>(({ className, inset, ...props }, ref) => (
-))
-DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName
+));
+DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
const DropdownMenuCheckboxItem = React.forwardRef<
React.ElementRef,
- React.ComponentPropsWithoutRef
+ React.ComponentPropsWithoutRef & {
+ checked?: boolean;
+ className?: string;
+ }
>(({ className, children, checked, ...props }, ref) => (
{children}
-))
+));
DropdownMenuCheckboxItem.displayName =
- DropdownMenuPrimitive.CheckboxItem.displayName
+ DropdownMenuPrimitive.CheckboxItem.displayName;
const DropdownMenuRadioItem = React.forwardRef<
React.ElementRef,
- React.ComponentPropsWithoutRef
+ React.ComponentPropsWithoutRef & {
+ className?: string;
+ }
>(({ className, children, ...props }, ref) => (
@@ -135,13 +147,14 @@ const DropdownMenuRadioItem = React.forwardRef<
{children}
-))
-DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName
+));
+DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
const DropdownMenuLabel = React.forwardRef<
React.ElementRef,
React.ComponentPropsWithoutRef & {
- inset?: boolean
+ inset?: boolean;
+ className?: string;
}
>(({ className, inset, ...props }, ref) => (
-))
-DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName
+));
+DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
const DropdownMenuSeparator = React.forwardRef<
React.ElementRef,
- React.ComponentPropsWithoutRef
+ React.ComponentPropsWithoutRef & {
+ className?: string;
+ }
>(({ className, ...props }, ref) => (
-))
-DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName
+));
+DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
const DropdownMenuShortcut = ({
className,
...props
-}: React.HTMLAttributes) => {
+}: React.HTMLAttributes & { className?: string }) => {
return (
- )
-}
-DropdownMenuShortcut.displayName = "DropdownMenuShortcut"
+ );
+};
+DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
export {
DropdownMenu,
@@ -197,4 +212,4 @@ export {
DropdownMenuSubContent,
DropdownMenuSubTrigger,
DropdownMenuRadioGroup,
-}
+};
diff --git a/src/components/ui/scroll-area.tsx b/src/components/ui/scroll-area.tsx
index 54b87cd..c1c8b0a 100644
--- a/src/components/ui/scroll-area.tsx
+++ b/src/components/ui/scroll-area.tsx
@@ -1,13 +1,15 @@
-"use client"
+"use client";
-import * as React from "react"
-import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
+import * as React from "react";
+import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
const ScrollArea = React.forwardRef<
React.ElementRef,
- React.ComponentPropsWithoutRef
+ React.ComponentPropsWithoutRef & {
+ className?: string;
+ }
>(({ className, children, ...props }, ref) => (
-))
-ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName
+));
+ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
const ScrollBar = React.forwardRef<
React.ElementRef,
- React.ComponentPropsWithoutRef
+ React.ComponentPropsWithoutRef<
+ typeof ScrollAreaPrimitive.ScrollAreaScrollbar
+ > & {
+ orientation?: "horizontal" | "vertical";
+ className?: string;
+ }
>(({ className, orientation = "vertical", ...props }, ref) => (
-))
-ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName
+));
+ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
-export { ScrollArea, ScrollBar }
+export { ScrollArea, ScrollBar };
diff --git a/src/components/ui/sheet.tsx b/src/components/ui/sheet.tsx
index 98cdd40..b83e197 100644
--- a/src/components/ui/sheet.tsx
+++ b/src/components/ui/sheet.tsx
@@ -1,40 +1,42 @@
-"use client"
+"use client";
-import * as React from "react"
-import * as SheetPrimitive from "@radix-ui/react-dialog"
-import { cva, type VariantProps } from "class-variance-authority"
-import { X } from "lucide-react"
+import * as React from "react";
+import * as SheetPrimitive from "@radix-ui/react-dialog";
+import { cva, type VariantProps } from "class-variance-authority";
+import { X } from "lucide-react";
-import { cn } from "@/lib/utils"
+import { cn } from "@/lib/utils";
-const Sheet = SheetPrimitive.Root
+const Sheet = SheetPrimitive.Root;
-const SheetTrigger = SheetPrimitive.Trigger
+const SheetTrigger = SheetPrimitive.Trigger;
-const SheetClose = SheetPrimitive.Close
+const SheetClose = SheetPrimitive.Close;
const SheetPortal = ({
className,
...props
}: SheetPrimitive.DialogPortalProps) => (
-)
-SheetPortal.displayName = SheetPrimitive.Portal.displayName
+);
+SheetPortal.displayName = SheetPrimitive.Portal.displayName;
const SheetOverlay = React.forwardRef<
React.ElementRef,
- React.ComponentPropsWithoutRef
+ React.ComponentPropsWithoutRef & {
+ className?: string;
+ }
>(({ className, ...props }, ref) => (
-))
-SheetOverlay.displayName = SheetPrimitive.Overlay.displayName
+));
+SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
const sheetVariants = cva(
"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
@@ -52,8 +54,8 @@ const sheetVariants = cva(
defaultVariants: {
side: "right",
},
- }
-)
+ },
+);
interface SheetContentProps
extends React.ComponentPropsWithoutRef,
@@ -77,60 +79,68 @@ const SheetContent = React.forwardRef<
-))
-SheetContent.displayName = SheetPrimitive.Content.displayName
+));
+SheetContent.displayName = SheetPrimitive.Content.displayName;
const SheetHeader = ({
className,
...props
-}: React.HTMLAttributes) => (
+}: React.HTMLAttributes & {
+ className?: string;
+}) => (
-)
-SheetHeader.displayName = "SheetHeader"
+);
+SheetHeader.displayName = "SheetHeader";
const SheetFooter = ({
className,
...props
-}: React.HTMLAttributes) => (
+}: React.HTMLAttributes & {
+ className?: string;
+}) => (
-)
-SheetFooter.displayName = "SheetFooter"
+);
+SheetFooter.displayName = "SheetFooter";
const SheetTitle = React.forwardRef<
React.ElementRef,
- React.ComponentPropsWithoutRef
+ React.ComponentPropsWithoutRef & {
+ className?: string;
+ }
>(({ className, ...props }, ref) => (
-))
-SheetTitle.displayName = SheetPrimitive.Title.displayName
+));
+SheetTitle.displayName = SheetPrimitive.Title.displayName;
const SheetDescription = React.forwardRef<
React.ElementRef,
- React.ComponentPropsWithoutRef
+ React.ComponentPropsWithoutRef & {
+ className?: string;
+ }
>(({ className, ...props }, ref) => (
-))
-SheetDescription.displayName = SheetPrimitive.Description.displayName
+));
+SheetDescription.displayName = SheetPrimitive.Description.displayName;
export {
Sheet,
@@ -141,4 +151,4 @@ export {
SheetFooter,
SheetTitle,
SheetDescription,
-}
+};
diff --git a/src/lib/utils.ts b/src/lib/utils.ts
index f282c81..1eec7e8 100644
--- a/src/lib/utils.ts
+++ b/src/lib/utils.ts
@@ -1,5 +1,5 @@
import classNames from "classnames";
-export function cn(...inputs: any) {
- return classNames(inputs)
+export function cn(...inputs: any[]) {
+ return classNames(inputs);
}
diff --git a/tailwind.config.js b/tailwind.config.js
index 0377ea1..c05b2ff 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -2,11 +2,11 @@
module.exports = {
darkMode: ["class"],
content: [
- './pages/**/*.{ts,tsx}',
- './components/**/*.{ts,tsx}',
- './app/**/*.{ts,tsx}',
- './src/**/*.{ts,tsx}',
- ],
+ "./pages/**/*.{ts,tsx}",
+ "./components/**/*.{ts,tsx}",
+ "./app/**/*.{ts,tsx}",
+ "./src/**/*.{ts,tsx}",
+ ],
theme: {
container: {
center: true,
@@ -73,4 +73,4 @@ module.exports = {
},
},
plugins: [require("tailwindcss-animate")],
-}
\ No newline at end of file
+};
diff --git a/tsconfig.json b/tsconfig.json
index 1f5a328..2211d51 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -23,14 +23,6 @@
"@/*": ["./src/*"]
}
},
- "include": [
- "next-env.d.ts",
- "src/**/*",
- "**/*.ts",
- "**/*.tsx",
- ".next/types/**/*.ts",
- "./*.js",
- "app"
- ],
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}