Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Replace deprecated React types, remove unnecessary imports #72

Merged
merged 6 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified bun.lockb
Binary file not shown.
50 changes: 25 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,65 +19,65 @@
"s3:start": "docker-compose up s3"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.637.0",
"@aws-sdk/client-s3": "^3.679.0",
"@lucia-auth/adapter-drizzle": "^1.1.0",
"@radix-ui/react-avatar": "^1.1.0",
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-dropdown-menu": "^2.1.1",
"@radix-ui/react-avatar": "^1.1.1",
"@radix-ui/react-dialog": "^1.1.2",
"@radix-ui/react-dropdown-menu": "^2.1.2",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-popover": "^1.1.1",
"@radix-ui/react-popover": "^1.1.2",
"@radix-ui/react-scroll-area": "^1.2.0",
"@radix-ui/react-select": "^2.1.1",
"@radix-ui/react-select": "^2.1.2",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.1",
"@radix-ui/react-tooltip": "^1.1.3",
"@t3-oss/env-nextjs": "^0.10.1",
"@tanstack/react-form": "^0.34.1",
"@tanstack/react-query": "^5.53.1",
"@tanstack/react-query": "^5.59.16",
"@tanstack/zod-form-adapter": "^0.34.1",
"@trpc/client": "^11.0.0-rc.490",
"@trpc/react-query": "^11.0.0-rc.490",
"@trpc/server": "^11.0.0-rc.490",
"@trpc/client": "^11.0.0-rc.599",
"@trpc/react-query": "^11.0.0-rc.599",
"@trpc/server": "^11.0.0-rc.599",
"cmdk": "1.0.0",
"country-flag-icons": "^1.5.12",
"country-flag-icons": "^1.5.13",
"cva": "^1.0.0-beta.1",
"date-fns": "^4.1.0",
"drizzle-orm": "^0.33.0",
"lucia": "^3.2.0",
"lucia": "^3.2.2",
"lucide-react": "^0.396.0",
"next": "15.0.1",
"next": "^15.0.2-canary.9",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"next": "^15.0.2-canary.9",
"next": "^15.0.1",

Dont use canary version for next use the stable version. React uses release candidate because it is required in the stable Next15 version

"next-intl": "^3.23.5",
"next-themes": "1.0.0-beta.0",
"nuqs": "^2.0.4",
"postgres": "^3.4.4",
"react": "19.0.0-rc-69d4b800-20241021",
"react-day-picker": "^9.1.4",
"react-dom": "19.0.0-rc-69d4b800-20241021",
"postgres": "^3.4.5",
"react": "^19.0.0-rc-fb9a90fa48-20240614",
"react-day-picker": "^9.2.1",
"react-dom": "^19.0.0-rc-fb9a90fa48-20240614",
"reading-time": "^1.5.0",
"superjson": "^2.2.1",
"tailwind-merge": "^2.5.2",
"tailwind-merge": "^2.5.4",
"vaul": "^1.1.0",
"zod": "^3.23.8"
},
"devDependencies": {
"@biomejs/biome": "^1.9.1",
"@biomejs/biome": "^1.9.4",
"@fluid-tailwind/tailwind-merge": "^0.0.2",
"@types/bun": "^1.1.12",
"@types/react": "npm:[email protected]",
"@types/react-dom": "npm:[email protected]",
"autoprefixer": "^10.4.20",
"client-only": "^0.0.1",
"cross-env": "^7.0.3",
"drizzle-kit": "^0.24.1",
"drizzle-kit": "^0.24.2",
"fluid-tailwind": "^1.0.3",
"lefthook": "^1.7.14",
"postcss": "^8.4.38",
"lefthook": "^1.8.1",
"postcss": "^8.4.47",
"server-only": "^0.0.1",
"tailwind-scrollbar": "^3.1.0",
"tailwindcss": "^3.4.4",
"tailwindcss": "^3.4.14",
"tailwindcss-animate": "^1.0.7",
"tailwindcss-radix": "^3.0.5",
"typescript": "^5.5.0"
"typescript": "^5.6.3"
},
"overrides": {
"@types/react": "npm:[email protected]",
Expand Down
10 changes: 5 additions & 5 deletions src/components/ui/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import { cx } from '@/lib/utils';
import * as AvatarPrimitive from '@radix-ui/react-avatar';
import * as React from 'react';
import { forwardRef } from 'react';

const Avatar = React.forwardRef<
React.ElementRef<typeof AvatarPrimitive.Root>,
const Avatar = forwardRef<
React.ComponentRef<typeof AvatarPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
>(({ className, ...props }, ref) => (
<AvatarPrimitive.Root
Expand All @@ -19,8 +19,8 @@ const Avatar = React.forwardRef<
));
Avatar.displayName = AvatarPrimitive.Root.displayName;

const AvatarFallback = React.forwardRef<
React.ElementRef<typeof AvatarPrimitive.Fallback>,
const AvatarFallback = forwardRef<
React.ComponentRef<typeof AvatarPrimitive.Fallback>,
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
>(({ className, ...props }, ref) => (
<AvatarPrimitive.Fallback
Expand Down
1 change: 0 additions & 1 deletion src/components/ui/Badge.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { type VariantProps, cva, cx } from '@/lib/utils';
import type * as React from 'react';

const badgeVariants = cva({
base: 'inline-flex items-center rounded-md border px-2.5 py-0.5 font-semibold text-xs transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
Expand Down
4 changes: 2 additions & 2 deletions src/components/ui/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type VariantProps, cva } from '@/lib/utils';
import { Slot } from '@radix-ui/react-slot';
import * as React from 'react';
import { forwardRef } from 'react';

const buttonVariants = cva({
base: 'inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium text-sm 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',
Expand Down Expand Up @@ -39,7 +39,7 @@ export interface ButtonProps
asChild?: boolean;
}

const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
const Button = forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : 'button';
return (
Expand Down
37 changes: 18 additions & 19 deletions src/components/ui/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
import { cx } from '@/lib/utils';
import * as React from 'react';
import { forwardRef } from 'react';

type CardTitleProps = {
level?: 'h2' | 'h3' | 'h4';
} & React.HTMLAttributes<HTMLHeadingElement>;

const Card = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cx(
'rounded-lg border bg-card text-card-foreground shadow-sm',
className,
)}
{...props}
/>
));
const Card = forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
({ className, ...props }, ref) => (
<div
ref={ref}
className={cx(
'rounded-lg border bg-card text-card-foreground shadow-sm',
className,
)}
{...props}
/>
),
);
Card.displayName = 'Card';

const CardHeader = React.forwardRef<
const CardHeader = forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
Expand All @@ -32,7 +31,7 @@ const CardHeader = React.forwardRef<
));
CardHeader.displayName = 'CardHeader';

const CardTitle = React.forwardRef<HTMLParagraphElement, CardTitleProps>(
const CardTitle = forwardRef<HTMLParagraphElement, CardTitleProps>(
({ level = 'h3', className, ...props }, ref) => {
const Component = level;

Expand All @@ -50,7 +49,7 @@ const CardTitle = React.forwardRef<HTMLParagraphElement, CardTitleProps>(
);
CardTitle.displayName = 'CardTitle';

const CardDescription = React.forwardRef<
const CardDescription = forwardRef<
HTMLParagraphElement,
React.HTMLAttributes<HTMLParagraphElement>
>(({ className, ...props }, ref) => (
Expand All @@ -62,15 +61,15 @@ const CardDescription = React.forwardRef<
));
CardDescription.displayName = 'CardDescription';

const CardContent = React.forwardRef<
const CardContent = forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div ref={ref} className={cx('p-6 pt-0', className)} {...props} />
));
CardContent.displayName = 'CardContent';

const CardFooter = React.forwardRef<
const CardFooter = forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
Expand Down
6 changes: 3 additions & 3 deletions src/components/ui/Combobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
} from '@/components/ui/Popover';
import { cx } from '@/lib/utils';
import { CheckIcon, ChevronsUpDownIcon } from 'lucide-react';
import * as React from 'react';
import { useState } from 'react';

type ComboboxProps = {
choices: {
Expand All @@ -42,8 +42,8 @@ function Combobox({
initialValue,
ariaLabel,
}: ComboboxProps) {
const [open, setOpen] = React.useState(false);
const [value, setValue] = React.useState<string | null>(initialValue ?? '');
const [open, setOpen] = useState(false);
const [value, setValue] = useState<string | null>(initialValue ?? '');

return (
<Popover open={open} onOpenChange={setOpen}>
Expand Down
30 changes: 15 additions & 15 deletions src/components/ui/Command.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { cx } from '@/lib/utils';
import type { DialogProps } from '@radix-ui/react-dialog';
import { Command as CommandPrimitive } from 'cmdk';
import { SearchIcon } from 'lucide-react';
import * as React from 'react';
import { forwardRef } from 'react';

const Command = React.forwardRef<
React.ElementRef<typeof CommandPrimitive>,
const Command = forwardRef<
React.ComponentRef<typeof CommandPrimitive>,
React.ComponentPropsWithoutRef<typeof CommandPrimitive>
>(({ className, ...props }, ref) => (
<CommandPrimitive
Expand Down Expand Up @@ -36,8 +36,8 @@ const CommandDialog = ({ children, ...props }: CommandDialogProps) => {
);
};

const CommandInput = React.forwardRef<
React.ElementRef<typeof CommandPrimitive.Input>,
const CommandInput = forwardRef<
React.ComponentRef<typeof CommandPrimitive.Input>,
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>
>(({ className, ...props }, ref) => (
<div className='flex items-center border-b px-3' cmdk-input-wrapper=''>
Expand All @@ -55,8 +55,8 @@ const CommandInput = React.forwardRef<

CommandInput.displayName = CommandPrimitive.Input.displayName;

const CommandList = React.forwardRef<
React.ElementRef<typeof CommandPrimitive.List>,
const CommandList = forwardRef<
React.ComponentRef<typeof CommandPrimitive.List>,
React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>
>(({ className, ...props }, ref) => (
<CommandPrimitive.List
Expand All @@ -68,8 +68,8 @@ const CommandList = React.forwardRef<

CommandList.displayName = CommandPrimitive.List.displayName;

const CommandEmpty = React.forwardRef<
React.ElementRef<typeof CommandPrimitive.Empty>,
const CommandEmpty = forwardRef<
React.ComponentRef<typeof CommandPrimitive.Empty>,
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>
>((props, ref) => (
<CommandPrimitive.Empty
Expand All @@ -81,8 +81,8 @@ const CommandEmpty = React.forwardRef<

CommandEmpty.displayName = CommandPrimitive.Empty.displayName;

const CommandGroup = React.forwardRef<
React.ElementRef<typeof CommandPrimitive.Group>,
const CommandGroup = forwardRef<
React.ComponentRef<typeof CommandPrimitive.Group>,
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>
>(({ className, ...props }, ref) => (
<CommandPrimitive.Group
Expand All @@ -97,8 +97,8 @@ const CommandGroup = React.forwardRef<

CommandGroup.displayName = CommandPrimitive.Group.displayName;

const CommandSeparator = React.forwardRef<
React.ElementRef<typeof CommandPrimitive.Separator>,
const CommandSeparator = forwardRef<
React.ComponentRef<typeof CommandPrimitive.Separator>,
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>
>(({ className, ...props }, ref) => (
<CommandPrimitive.Separator
Expand All @@ -109,8 +109,8 @@ const CommandSeparator = React.forwardRef<
));
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;

const CommandItem = React.forwardRef<
React.ElementRef<typeof CommandPrimitive.Item>,
const CommandItem = forwardRef<
React.ComponentRef<typeof CommandPrimitive.Item>,
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
>(({ className, ...props }, ref) => (
<CommandPrimitive.Item
Expand Down
18 changes: 9 additions & 9 deletions src/components/ui/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { cx } from '@/lib/utils';
import * as DialogPrimitive from '@radix-ui/react-dialog';
import { XIcon } from 'lucide-react';
import * as React from 'react';
import { forwardRef } from 'react';

const Dialog = DialogPrimitive.Root;

Expand All @@ -13,8 +13,8 @@ const DialogPortal = DialogPrimitive.Portal;

const DialogClose = DialogPrimitive.Close;

const DialogOverlay = React.forwardRef<
React.ElementRef<typeof DialogPrimitive.Overlay>,
const DialogOverlay = forwardRef<
React.ComponentRef<typeof DialogPrimitive.Overlay>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
>(({ className, ...props }, ref) => (
<DialogPrimitive.Overlay
Expand All @@ -28,8 +28,8 @@ const DialogOverlay = React.forwardRef<
));
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;

const DialogContent = React.forwardRef<
React.ElementRef<typeof DialogPrimitive.Content>,
const DialogContent = forwardRef<
React.ComponentRef<typeof DialogPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
>(({ className, children, ...props }, ref) => (
<DialogPortal>
Expand Down Expand Up @@ -80,8 +80,8 @@ const DialogFooter = ({
);
DialogFooter.displayName = 'DialogFooter';

const DialogTitle = React.forwardRef<
React.ElementRef<typeof DialogPrimitive.Title>,
const DialogTitle = forwardRef<
React.ComponentRef<typeof DialogPrimitive.Title>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
>(({ className, ...props }, ref) => (
<DialogPrimitive.Title
Expand All @@ -95,8 +95,8 @@ const DialogTitle = React.forwardRef<
));
DialogTitle.displayName = DialogPrimitive.Title.displayName;

const DialogDescription = React.forwardRef<
React.ElementRef<typeof DialogPrimitive.Description>,
const DialogDescription = forwardRef<
React.ComponentRef<typeof DialogPrimitive.Description>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
>(({ className, ...props }, ref) => (
<DialogPrimitive.Description
Expand Down
Loading
Loading