Skip to content

Commit dc63f8a

Browse files
committed
Use cn function
1 parent 5084921 commit dc63f8a

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

resources/js/components/appearance-tabs.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Appearance, useAppearance } from '@/hooks/use-appearance';
2+
import { cn } from '@/lib/utils';
23
import { LucideIcon, Monitor, Moon, Sun } from 'lucide-react';
34
import { HTMLAttributes } from 'react';
45

@@ -12,16 +13,17 @@ export default function AppearanceToggleTab({ className = '', ...props }: HTMLAt
1213
];
1314

1415
return (
15-
<div className={`inline-flex gap-1 rounded-lg bg-neutral-100 p-1 dark:bg-neutral-800 ${className}`} {...props}>
16+
<div className={cn('inline-flex gap-1 rounded-lg bg-neutral-100 p-1 dark:bg-neutral-800', className)} {...props}>
1617
{tabs.map(({ value, icon: Icon, label }) => (
1718
<button
1819
key={value}
1920
onClick={() => updateAppearance(value)}
20-
className={`flex items-center rounded-md px-3.5 py-1.5 transition-colors ${
21+
className={cn(
22+
'flex items-center rounded-md px-3.5 py-1.5 transition-colors',
2123
appearance === value
2224
? 'bg-white shadow-sm dark:bg-neutral-700 dark:text-neutral-100'
2325
: 'text-neutral-500 hover:bg-neutral-200/60 hover:text-black dark:text-neutral-400 dark:hover:bg-neutral-700/60'
24-
} `}
26+
)}
2527
>
2628
<Icon className="-ml-1 h-4 w-4" />
2729
<span className="ml-1.5 text-sm">{label}</span>

resources/js/components/input-error.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
import { cn } from '@/lib/utils';
12
import { HTMLAttributes } from 'react';
23

34
export default function InputError({ message, className = '', ...props }: HTMLAttributes<HTMLParagraphElement> & { message?: string }) {
45
return message ? (
5-
<p {...props} className={'text-sm text-red-600 dark:text-red-400 ' + className}>
6+
<p {...props} className={cn('text-sm text-red-600 dark:text-red-400', className)}>
67
{message}
78
</p>
89
) : null;

resources/js/components/text-link.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { cn } from '@/lib/utils';
12
import { Link } from '@inertiajs/react';
23
import { ComponentProps } from 'react';
34

@@ -6,7 +7,7 @@ type LinkProps = ComponentProps<typeof Link>;
67
export default function TextLink({ className = '', children, ...props }: LinkProps) {
78
return (
89
<Link
9-
className={`underline decoration-neutral-400 underline-offset-2 duration-300 ease-out hover:decoration-neutral-700 ${className}`}
10+
className={cn('underline decoration-neutral-400 underline-offset-2 duration-300 ease-out hover:decoration-neutral-700', className)}
1011
{...props}
1112
>
1213
{children}

0 commit comments

Comments
 (0)