Skip to content

Commit 410c532

Browse files
committed
Made buttons and text default shadcdn
1 parent f0daa68 commit 410c532

8 files changed

Lines changed: 41 additions & 33 deletions

File tree

app/next-client-app/app/(protected)/datasets/columns.tsx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
DropdownMenu,
99
DropdownMenuContent,
1010
DropdownMenuItem,
11-
DropdownMenuTrigger,
11+
DropdownMenuTrigger
1212
} from "@/components/ui/dropdown-menu";
1313
import { EyeNoneIcon, EyeOpenIcon, Pencil2Icon } from "@radix-ui/react-icons";
1414
import { format } from "date-fns/format";
@@ -22,7 +22,7 @@ export const columns: ColumnDef<DataSet>[] = [
2222
<DataTableColumnHeader column={column} title="ID" sortName="id" />
2323
),
2424
enableHiding: false,
25-
enableSorting: true,
25+
enableSorting: true
2626
},
2727
{
2828
id: "Name",
@@ -35,12 +35,15 @@ export const columns: ColumnDef<DataSet>[] = [
3535
const { id, name } = row.original;
3636
return (
3737
<Link href={`/datasets/${id}/`}>
38-
<Button variant={"link"} className="font-bold">
38+
<Button
39+
variant="link"
40+
className="font-bold text-black dark:text-white"
41+
>
3942
{name}
4043
</Button>
4144
</Link>
4245
);
43-
},
46+
}
4447
},
4548
{
4649
id: "Data Partner",
@@ -54,7 +57,7 @@ export const columns: ColumnDef<DataSet>[] = [
5457
/>
5558
),
5659
enableHiding: true,
57-
enableSorting: true,
60+
enableSorting: true
5861
},
5962
{
6063
accessorKey: "visibility",
@@ -66,7 +69,7 @@ export const columns: ColumnDef<DataSet>[] = [
6669
/>
6770
),
6871
enableHiding: true,
69-
enableSorting: true,
72+
enableSorting: true
7073
},
7174

7275
{
@@ -84,7 +87,7 @@ export const columns: ColumnDef<DataSet>[] = [
8487
cell: ({ row }) => {
8588
const date = new Date(row.original.created_at);
8689
return format(date, "MMM dd, yyyy h:mm a");
87-
},
90+
}
8891
},
8992
{
9093
id: "actions",
@@ -111,7 +114,7 @@ export const columns: ColumnDef<DataSet>[] = [
111114
id: id,
112115
hidden: hidden,
113116
ObjName: row.original.name,
114-
type: "datasets",
117+
type: "datasets"
115118
})
116119
}
117120
>
@@ -132,6 +135,6 @@ export const columns: ColumnDef<DataSet>[] = [
132135
);
133136
},
134137
header: "Actions",
135-
enableHiding: false,
136-
},
138+
enableHiding: false
139+
}
137140
];

app/next-client-app/app/(protected)/scanreports/[id]/columns.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const columns: ColumnDef<ScanReportTable>[] = [
2222
return (
2323
<div>
2424
<Link href={`/scanreports/${scan_report}/tables/${id}`}>
25-
<Button variant={"link"} className="font-bold">
25+
<Button variant="link" className="font-bold text-black dark:text-white">
2626
{name}
2727
</Button>
2828
</Link>

app/next-client-app/app/(protected)/scanreports/[id]/mapping_rules/columns.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export const columns: ColumnDef<MappingRule>[] = [
7878
<p className="text-destructive">{key}</p>{" "}
7979
<ArrowRight size="16px" className="ml-2" />
8080
</div>
81-
<p className="text-success-foreground">
81+
<p className="text-success">
8282
{term_mapping[key]} {omop_term}
8383
</p>
8484
</div>

app/next-client-app/app/(protected)/scanreports/[id]/tables/[tableId]/columns.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const columns = (
3333
prePath.endsWith("/") ? prePath : prePath + "/"
3434
}fields/${id}`}
3535
>
36-
<Button variant="link" className="font-bold">
36+
<Button variant="link" className="font-bold text-black dark:text-white">
3737
{name}
3838
</Button>
3939
</Link>

app/next-client-app/app/(protected)/scanreports/columns.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const columns: ColumnDef<ScanReport>[] = [
4444
const { id, dataset } = row.original;
4545
return (
4646
<Link href={`/scanreports/${id}`}>
47-
<Button variant={"link"} className="font-bold">
47+
<Button variant="link" className="font-bold text-black dark:text-white">
4848
{dataset}
4949
</Button>
5050
</Link>

app/next-client-app/components/scanreports/DeleteDialog.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
DialogDescription,
77
DialogFooter,
88
DialogHeader,
9-
DialogTitle,
9+
DialogTitle
1010
} from "../ui/dialog";
1111
import { toast } from "sonner";
1212
import { Button } from "../ui/button";
@@ -28,7 +28,7 @@ const DeleteDialog = ({
2828
redirect = false,
2929
isOpen,
3030
setOpen = () => {},
31-
needTrigger = false,
31+
needTrigger = false
3232
}: DeleteDialogProps) => {
3333
const router = useRouter();
3434

@@ -47,7 +47,7 @@ const DeleteDialog = ({
4747
<Dialog open={isOpen} onOpenChange={() => setOpen(false)}>
4848
{needTrigger && (
4949
<DialogTrigger asChild>
50-
<div className="hover:bg-accent text-destructive relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-destructive data-[disabled]:pointer-events-none data-[disabled]:opacity-50">
50+
<div className="text-black dark:text-white hover:text-destructive hover:dark:text-destructive hover:bg-accent relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-destructive data-[disabled]:pointer-events-none data-[disabled]:opacity-50">
5151
<TrashIcon className="mr-2 size-4" />
5252
Delete Scan Report
5353
</div>

app/next-client-app/components/scanreports/EditButton.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function EditButton({
1111
type,
1212
permissions,
1313
prePath,
14-
generalStatus,
14+
generalStatus
1515
}: {
1616
scanreportId?: number;
1717
tableId?: number;
@@ -40,6 +40,11 @@ export function EditButton({
4040
<Button
4141
variant={type === "table" || type === "field" ? "secondary" : "default"}
4242
disabled={canEdit ? false : true}
43+
className={cn(
44+
type === "table" || type === "field"
45+
? "hover:bg-gray-300 dark:hover:bg-gray-700"
46+
: "hover:bg-primary/90"
47+
)}
4348
>
4449
{type === "table" ? "Edit Table" : type === "field" ? "Edit Field" : ""}
4550
<Pencil className="ml-2 size-4" />
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import * as React from "react"
2-
import { Slot } from "@radix-ui/react-slot"
3-
import { cva, type VariantProps } from "class-variance-authority"
1+
import * as React from "react";
2+
import { Slot } from "@radix-ui/react-slot";
3+
import { cva, type VariantProps } from "class-variance-authority";
44

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

77
const buttonVariants = cva(
88
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
99
{
1010
variants: {
1111
variant: {
1212
default:
13-
"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
13+
"bg-black text-white dark:bg-white dark:text-black shadow-xs hover:bg-black/90 dark:hover:bg-white/90",
1414
destructive:
1515
"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
1616
outline:
@@ -19,21 +19,21 @@ const buttonVariants = cva(
1919
"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
2020
ghost:
2121
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
22-
link: "text-primary underline-offset-4 hover:underline",
22+
link: "text-primary underline-offset-4 hover:underline"
2323
},
2424
size: {
2525
default: "h-9 px-4 py-2 has-[>svg]:px-3",
2626
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
2727
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
28-
icon: "size-9",
29-
},
28+
icon: "size-9"
29+
}
3030
},
3131
defaultVariants: {
3232
variant: "default",
33-
size: "default",
34-
},
33+
size: "default"
34+
}
3535
}
36-
)
36+
);
3737

3838
function Button({
3939
className,
@@ -43,17 +43,17 @@ function Button({
4343
...props
4444
}: React.ComponentProps<"button"> &
4545
VariantProps<typeof buttonVariants> & {
46-
asChild?: boolean
46+
asChild?: boolean;
4747
}) {
48-
const Comp = asChild ? Slot : "button"
48+
const Comp = asChild ? Slot : "button";
4949

5050
return (
5151
<Comp
5252
data-slot="button"
5353
className={cn(buttonVariants({ variant, size, className }))}
5454
{...props}
5555
/>
56-
)
56+
);
5757
}
5858

59-
export { Button, buttonVariants }
59+
export { Button, buttonVariants };

0 commit comments

Comments
 (0)