Skip to content

Commit 1fadd21

Browse files
committed
refactor: organize imports and export order in dialog and drawer components
1 parent 5b5ed23 commit 1fadd21

File tree

2 files changed

+60
-60
lines changed

2 files changed

+60
-60
lines changed

app/components/ui/dialog.tsx

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import * as React from "react"
2-
import * as DialogPrimitive from "@radix-ui/react-dialog"
3-
import { X } from "lucide-react"
1+
import * as DialogPrimitive from "@radix-ui/react-dialog";
2+
import { X } from "lucide-react";
3+
import * as React from "react";
44

5-
import { cn } from "~/lib/utils"
5+
import { cn } from "~/lib/utils";
66

7-
const Dialog = DialogPrimitive.Root
7+
const Dialog = DialogPrimitive.Root;
88

9-
const DialogTrigger = DialogPrimitive.Trigger
9+
const DialogTrigger = DialogPrimitive.Trigger;
1010

11-
const DialogPortal = DialogPrimitive.Portal
11+
const DialogPortal = DialogPrimitive.Portal;
1212

13-
const DialogClose = DialogPrimitive.Close
13+
const DialogClose = DialogPrimitive.Close;
1414

1515
const DialogOverlay = React.forwardRef<
1616
React.ElementRef<typeof DialogPrimitive.Overlay>,
@@ -19,13 +19,13 @@ const DialogOverlay = React.forwardRef<
1919
<DialogPrimitive.Overlay
2020
ref={ref}
2121
className={cn(
22-
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
23-
className
22+
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
23+
className,
2424
)}
2525
{...props}
2626
/>
27-
))
28-
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
27+
));
28+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
2929

3030
const DialogContent = React.forwardRef<
3131
React.ElementRef<typeof DialogPrimitive.Content>,
@@ -37,7 +37,7 @@ const DialogContent = React.forwardRef<
3737
ref={ref}
3838
className={cn(
3939
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
40-
className
40+
className,
4141
)}
4242
{...props}
4343
>
@@ -48,8 +48,8 @@ const DialogContent = React.forwardRef<
4848
</DialogPrimitive.Close>
4949
</DialogPrimitive.Content>
5050
</DialogPortal>
51-
))
52-
DialogContent.displayName = DialogPrimitive.Content.displayName
51+
));
52+
DialogContent.displayName = DialogPrimitive.Content.displayName;
5353

5454
const DialogHeader = ({
5555
className,
@@ -58,12 +58,12 @@ const DialogHeader = ({
5858
<div
5959
className={cn(
6060
"flex flex-col space-y-1.5 text-center sm:text-left",
61-
className
61+
className,
6262
)}
6363
{...props}
6464
/>
65-
)
66-
DialogHeader.displayName = "DialogHeader"
65+
);
66+
DialogHeader.displayName = "DialogHeader";
6767

6868
const DialogFooter = ({
6969
className,
@@ -72,12 +72,12 @@ const DialogFooter = ({
7272
<div
7373
className={cn(
7474
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
75-
className
75+
className,
7676
)}
7777
{...props}
7878
/>
79-
)
80-
DialogFooter.displayName = "DialogFooter"
79+
);
80+
DialogFooter.displayName = "DialogFooter";
8181

8282
const DialogTitle = React.forwardRef<
8383
React.ElementRef<typeof DialogPrimitive.Title>,
@@ -87,12 +87,12 @@ const DialogTitle = React.forwardRef<
8787
ref={ref}
8888
className={cn(
8989
"text-lg font-semibold leading-none tracking-tight",
90-
className
90+
className,
9191
)}
9292
{...props}
9393
/>
94-
))
95-
DialogTitle.displayName = DialogPrimitive.Title.displayName
94+
));
95+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
9696

9797
const DialogDescription = React.forwardRef<
9898
React.ElementRef<typeof DialogPrimitive.Description>,
@@ -103,18 +103,18 @@ const DialogDescription = React.forwardRef<
103103
className={cn("text-sm text-muted-foreground", className)}
104104
{...props}
105105
/>
106-
))
107-
DialogDescription.displayName = DialogPrimitive.Description.displayName
106+
));
107+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
108108

109109
export {
110110
Dialog,
111-
DialogPortal,
112-
DialogOverlay,
113111
DialogClose,
114-
DialogTrigger,
115112
DialogContent,
116-
DialogHeader,
113+
DialogDescription,
117114
DialogFooter,
115+
DialogHeader,
116+
DialogOverlay,
117+
DialogPortal,
118118
DialogTitle,
119-
DialogDescription,
120-
}
119+
DialogTrigger,
120+
};

app/components/ui/drawer.tsx

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import * as React from "react"
2-
import { Drawer as DrawerPrimitive } from "vaul"
1+
import * as React from "react";
2+
import { Drawer as DrawerPrimitive } from "vaul";
33

4-
import { cn } from "~/lib/utils"
4+
import { cn } from "~/lib/utils";
55

66
const Drawer = ({
77
shouldScaleBackground = true,
@@ -11,14 +11,14 @@ const Drawer = ({
1111
shouldScaleBackground={shouldScaleBackground}
1212
{...props}
1313
/>
14-
)
15-
Drawer.displayName = "Drawer"
14+
);
15+
Drawer.displayName = "Drawer";
1616

17-
const DrawerTrigger = DrawerPrimitive.Trigger
17+
const DrawerTrigger = DrawerPrimitive.Trigger;
1818

19-
const DrawerPortal = DrawerPrimitive.Portal
19+
const DrawerPortal = DrawerPrimitive.Portal;
2020

21-
const DrawerClose = DrawerPrimitive.Close
21+
const DrawerClose = DrawerPrimitive.Close;
2222

2323
const DrawerOverlay = React.forwardRef<
2424
React.ElementRef<typeof DrawerPrimitive.Overlay>,
@@ -29,8 +29,8 @@ const DrawerOverlay = React.forwardRef<
2929
className={cn("fixed inset-0 z-50 bg-black/80", className)}
3030
{...props}
3131
/>
32-
))
33-
DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName
32+
));
33+
DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
3434

3535
const DrawerContent = React.forwardRef<
3636
React.ElementRef<typeof DrawerPrimitive.Content>,
@@ -42,16 +42,16 @@ const DrawerContent = React.forwardRef<
4242
ref={ref}
4343
className={cn(
4444
"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
45-
className
45+
className,
4646
)}
4747
{...props}
4848
>
4949
<div className="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" />
5050
{children}
5151
</DrawerPrimitive.Content>
5252
</DrawerPortal>
53-
))
54-
DrawerContent.displayName = "DrawerContent"
53+
));
54+
DrawerContent.displayName = "DrawerContent";
5555

5656
const DrawerHeader = ({
5757
className,
@@ -61,8 +61,8 @@ const DrawerHeader = ({
6161
className={cn("grid gap-1.5 p-4 text-center sm:text-left", className)}
6262
{...props}
6363
/>
64-
)
65-
DrawerHeader.displayName = "DrawerHeader"
64+
);
65+
DrawerHeader.displayName = "DrawerHeader";
6666

6767
const DrawerFooter = ({
6868
className,
@@ -72,8 +72,8 @@ const DrawerFooter = ({
7272
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
7373
{...props}
7474
/>
75-
)
76-
DrawerFooter.displayName = "DrawerFooter"
75+
);
76+
DrawerFooter.displayName = "DrawerFooter";
7777

7878
const DrawerTitle = React.forwardRef<
7979
React.ElementRef<typeof DrawerPrimitive.Title>,
@@ -83,12 +83,12 @@ const DrawerTitle = React.forwardRef<
8383
ref={ref}
8484
className={cn(
8585
"text-lg font-semibold leading-none tracking-tight",
86-
className
86+
className,
8787
)}
8888
{...props}
8989
/>
90-
))
91-
DrawerTitle.displayName = DrawerPrimitive.Title.displayName
90+
));
91+
DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
9292

9393
const DrawerDescription = React.forwardRef<
9494
React.ElementRef<typeof DrawerPrimitive.Description>,
@@ -99,18 +99,18 @@ const DrawerDescription = React.forwardRef<
9999
className={cn("text-sm text-muted-foreground", className)}
100100
{...props}
101101
/>
102-
))
103-
DrawerDescription.displayName = DrawerPrimitive.Description.displayName
102+
));
103+
DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
104104

105105
export {
106106
Drawer,
107-
DrawerPortal,
108-
DrawerOverlay,
109-
DrawerTrigger,
110107
DrawerClose,
111108
DrawerContent,
112-
DrawerHeader,
109+
DrawerDescription,
113110
DrawerFooter,
111+
DrawerHeader,
112+
DrawerOverlay,
113+
DrawerPortal,
114114
DrawerTitle,
115-
DrawerDescription,
116-
}
115+
DrawerTrigger,
116+
};

0 commit comments

Comments
 (0)