Skip to content

Commit 34f25c7

Browse files
committed
feat(web): kleros-app
1 parent 590862c commit 34f25c7

File tree

36 files changed

+743
-741
lines changed

36 files changed

+743
-741
lines changed

kleros-app/package.json

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22
"name": "@kleros/kleros-app",
33
"version": "1.0.0",
44
"source": "src/lib/index.ts",
5-
"main": "dist/index.js",
6-
"types": "dist/types.d.ts",
7-
"isLibrary": true,
5+
"main": "dist/main.js",
6+
"module": "dist/module.js",
7+
"types": "dist/index.d.ts",
88
"scripts": {
9-
"clear": "rm -r .parcel-cache",
9+
"clear": "rm -r ../.parcel-cache",
1010
"clean": "rm -rf dist",
1111
"start": "parcel src/index.html",
12-
"build": "parcel build",
12+
"build": "yarn clear & yarn clean & yarn parcel build",
1313
"check-style": "eslint 'src/**/*.{ts,tsx}' -fix",
14-
"check-types": "tsc --noEmit",
15-
"watch": "parcel watch"
14+
"check-types": "tsc --noEmit"
1615
},
1716
"repository": {
1817
"type": "git",
@@ -49,7 +48,16 @@
4948
"typescript": "^5.6.3"
5049
},
5150
"dependencies": {
51+
"@kleros/ui-components-library": "^2.15.0",
52+
"jose": "^5.9.6"
53+
},
54+
"peerDependencies": {
55+
"@tanstack/react-query": "^5.59.20",
56+
"graphql": "^16.9.0",
57+
"graphql-request": "^7.1.2",
5258
"react": "^18.3.1",
53-
"react-dom": "^18.3.1"
59+
"react-dom": "^18.3.1",
60+
"viem": "^2.21.42",
61+
"wagmi": "^2.12.27"
5462
}
5563
}

kleros-app/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const App = () => {
55
return (
66
<React.StrictMode>
77
<div>
8-
<h1>hello</h1>
8+
<h1>Kleros</h1>
99
</div>
1010
</React.StrictMode>
1111
);

kleros-app/src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<title>My First Parcel App</title>
6+
<title>Kleros App</title>
77
</head>
88
<body>
99
<div id="app"></div>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { useState } from "react";
2+
3+
export function useSessionStorage<T>(keyName: string, defaultValue: T) {
4+
const [storedValue, setStoredValue] = useState<T>(() => {
5+
try {
6+
const value = window.sessionStorage.getItem(keyName);
7+
8+
return value ? JSON.parse(value) : defaultValue;
9+
} catch (err) {
10+
return defaultValue;
11+
}
12+
});
13+
14+
const setValue = (newValue: T) => {
15+
try {
16+
window.sessionStorage.setItem(keyName, JSON.stringify(newValue));
17+
} finally {
18+
setStoredValue(newValue);
19+
}
20+
};
21+
22+
return [storedValue, setValue] as [T, (newValue: T) => void];
23+
}

kleros-app/src/lib/atlas/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from "./providers";
2+
export * from "./utils";

0 commit comments

Comments
 (0)