Skip to content

Commit bf5b6d0

Browse files
committed
chore: add clsx and tailwind-merge for class management
1 parent a1e7428 commit bf5b6d0

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

web/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
"@yornaath/batshit": "^0.9.0",
8282
"chart.js": "^3.9.1",
8383
"chartjs-adapter-moment": "^1.0.1",
84+
"clsx": "^2.1.1",
8485
"core-js": "^3.35.0",
8586
"graphql": "^16.9.0",
8687
"graphql-request": "^7.1.2",
@@ -102,6 +103,7 @@
102103
"react-toastify": "^9.1.3",
103104
"react-use": "^17.4.3",
104105
"subgraph-status": "^1.2.4",
106+
"tailwind-merge": "^3.3.1",
105107
"tailwindcss": "^4.1.16",
106108
"viem": "^2.27.2",
107109
"wagmi": "^2.14.10",

web/src/global.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
@import "../../node_modules/@kleros/ui-components-library/dist/assets/theme.css";
2-
@plugin "tailwindcss-react-aria-components";
32
@source "../../node_modules/@kleros/ui-components-library";
43
@tailwind utilities;
54

web/src/utils/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import { Roles } from "@kleros/kleros-app";
2+
import { ClassValue, clsx } from "clsx";
3+
import { twMerge } from "tailwind-merge";
24

35
export const isUndefined = (maybeObject: any): maybeObject is undefined => typeof maybeObject === "undefined";
46
export const capitalize = (str: string) => {
@@ -38,3 +40,7 @@ export const getFileUploaderMsg = (role: Roles, roleRestrictions?: Role[]) => {
3840
(1024 * 1024)
3941
).toFixed(2)} MB.`;
4042
};
43+
44+
export const cn = (...inputs: ClassValue[]) => {
45+
return twMerge(clsx(inputs));
46+
};

yarn.lock

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5563,6 +5563,7 @@ __metadata:
55635563
"@yornaath/batshit": "npm:^0.9.0"
55645564
chart.js: "npm:^3.9.1"
55655565
chartjs-adapter-moment: "npm:^1.0.1"
5566+
clsx: "npm:^2.1.1"
55665567
core-js: "npm:^3.35.0"
55675568
eslint: "npm:^8.56.0"
55685569
eslint-config-prettier: "npm:^8.10.0"
@@ -5589,6 +5590,7 @@ __metadata:
55895590
react-toastify: "npm:^9.1.3"
55905591
react-use: "npm:^17.4.3"
55915592
subgraph-status: "npm:^1.2.4"
5593+
tailwind-merge: "npm:^3.3.1"
55925594
tailwindcss: "npm:^4.1.16"
55935595
typescript: "npm:^5.3.3"
55945596
viem: "npm:^2.27.2"
@@ -31116,7 +31118,7 @@ __metadata:
3111631118
languageName: node
3111731119
linkType: hard
3111831120

31119-
"tailwind-merge@npm:^3.0.2":
31121+
"tailwind-merge@npm:^3.0.2, tailwind-merge@npm:^3.3.1":
3112031122
version: 3.3.1
3112131123
resolution: "tailwind-merge@npm:3.3.1"
3112231124
checksum: ad97f0763afdfdce785b8de50bc546951bb3cc803ab4f809cb10d654d9b7e28b0d19dead70ab9070edf479af68622a5f6ba16a21584fa8c21236855709dc648f

0 commit comments

Comments
 (0)