Skip to content

Commit 0a7d847

Browse files
authored
Merge pull request #73 from kleros/feat/add-homepage
Feat(web): add Home page
2 parents 0c20d85 + 586ddb5 commit 0a7d847

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+5083
-163
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"eslint-plugin-node": "^11.1.0",
3434
"eslint-plugin-prettier": "^3.4.1",
3535
"eslint-plugin-promise": "^5.1.1",
36+
"eslint-utils": "^3.0.0",
3637
"husky": "^7.0.0",
3738
"lint-staged": "^11.0.0",
3839
"npm-run-all": "^4.1.5",

web/.yarnrc.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
nodeLinker: node-modules
2-
cacheFolder: $HOME/.yarn_cache
32

web/codegen.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
schema: https://api.thegraph.com/subgraphs/name/alcercu/kleros-core
2+
documents: './src/hooks/queries/*.ts'
3+
generates:
4+
src/graphql/generated.ts:
5+
plugins:
6+
- typescript
7+
- typescript-operations

web/netlify.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
NETLIFY_USE_YARN = "true"
55
NETLIFY_YARN_WORKSPACES = "true"
66
YARN_ENABLE_GLOBAL_CACHE = "true"
7-
YARN_CACHE_FOLDER = "$HOME/.yarn_cache"
7+
# YARN_CACHE_FOLDER = "$HOME/.yarn_cache"
88
# YARN_VERSION = "3.2.0"

web/package.json

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@kleros/kleros-v2-web",
33
"version": "0.1.0",
44
"source": "src/index.html",
5-
"browserslist": "> 0.5%, last 2 versions, not dead, not ios_saf < 13",
5+
"browserslist": "> 0.5%, not dead",
66
"repository": "",
77
"author": "",
88
"license": "MIT",
@@ -14,6 +14,7 @@
1414
"layout": "./src/layout",
1515
"consts": "./src/consts",
1616
"hooks": "./src/hooks",
17+
"queries": "./src/hooks/queries",
1718
"pages": "./src/pages",
1819
"styles": "./src/styles",
1920
"svgs": "./src/assets/svgs"
@@ -25,36 +26,50 @@
2526
"start": "parcel",
2627
"build": "parcel build",
2728
"check-style": "eslint 'src/**/*.{js,jsx,ts,tsx}'",
28-
"check-types": "tsc --noEmit"
29+
"check-types": "tsc --noEmit",
30+
"generate": "graphql-codegen"
2931
},
3032
"devDependencies": {
31-
"@parcel/transformer-svg-react": "^2.2.1",
32-
"@types/react": "^17.0.38",
33-
"@types/react-dom": "^17.0.11",
33+
"@parcel/transformer-svg-react": "^2.5.0",
34+
"@types/react": "^18.0.0",
35+
"@types/react-dom": "^18.0.0",
3436
"@types/styled-components": "^5.1.21",
35-
"@typescript-eslint/eslint-plugin": "^5.10.1",
36-
"@typescript-eslint/parser": "^5.10.1",
37-
"eslint": "^8.7.0",
37+
"@typescript-eslint/eslint-plugin": "^5.27.0",
38+
"@typescript-eslint/parser": "^5.27.0",
39+
"@typescript-eslint/utils": "^5.27.0",
40+
"eslint": "^8.16.0",
3841
"eslint-config-prettier": "^8.3.0",
3942
"eslint-import-resolver-parcel": "^1.10.6",
4043
"eslint-plugin-import": "^2.25.4",
4144
"eslint-plugin-prettier": "^4.0.0",
4245
"eslint-plugin-react": "^7.28.0",
4346
"eslint-plugin-react-hooks": "^4.3.0",
4447
"eslint-plugin-security": "^1.4.0",
48+
"eslint-utils": "^3.0.0",
4549
"lru-cache": "^7.8.0",
46-
"parcel": "^2.4.1",
50+
"parcel": "^2.6.0",
4751
"prettier": "^2.5.1",
4852
"typescript": "^4.5.5"
4953
},
5054
"dependencies": {
55+
"@graphql-codegen/cli": "^2.6.2",
56+
"@graphql-codegen/typescript": "^2.4.9",
57+
"@graphql-codegen/typescript-operations": "^2.3.6",
5158
"@kleros/kleros-v2-contracts": "workspace:^",
52-
"@kleros/ui-components-library": "^0.1.5",
59+
"@kleros/ui-components-library": "^1.1.0",
60+
"chart.js": "^3.7.1",
61+
"chartjs-adapter-moment": "^1.0.0",
5362
"core-js": "^3.21.1",
63+
"ethers": "^5.6.5",
64+
"graphql": "^16.4.0",
65+
"graphql-request": "^4.2.0",
66+
"moment": "^2.29.3",
5467
"react": "^18.0.0",
68+
"react-chartjs-2": "^4.1.0",
5569
"react-dom": "^18.0.0",
5670
"react-is": "^18.0.0",
5771
"react-router-dom": "6",
58-
"styled-components": "^5.3.5"
72+
"styled-components": "^5.3.5",
73+
"swr": "^1.3.0"
5974
}
6075
}

web/src/app.tsx

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,43 @@
11
import React from "react";
2-
import { Routes, Route } from "react-router-dom";
32
import StyledComponentsProvider from "context/StyledComponentsProvider";
3+
import { SWRConfig } from "swr";
4+
import { request } from "graphql-request";
5+
import { Routes, Route } from "react-router-dom";
46
import Layout from "layout/index";
57
import Home from "./pages/home";
68

7-
const App: React.FC = () => (
8-
<StyledComponentsProvider>
9-
<Routes>
10-
<Route path="/" element={<Layout />}>
11-
<Route index element={<Home />} />
12-
<Route path="cases" element={<h1>Cases</h1>} />
13-
<Route path="courts" element={<h1>Courts</h1>} />
14-
<Route path="dashboard" element={<h1>Dashboard</h1>} />
15-
<Route
16-
path="*"
17-
element={<h1>Justice not found here ¯\_( ͡° ͜ʖ ͡°)_/¯</h1>}
18-
/>
19-
</Route>
20-
</Routes>
21-
</StyledComponentsProvider>
22-
);
9+
const fetcherBuilder =
10+
(url: string) =>
11+
({ query, variables }: { query: string; variables?: any }) => {
12+
console.log("fetch");
13+
return request(url, query, variables);
14+
};
15+
16+
const App: React.FC = () => {
17+
return (
18+
<StyledComponentsProvider>
19+
<SWRConfig
20+
value={{
21+
fetcher: fetcherBuilder(
22+
"https://api.thegraph.com/subgraphs/name/alcercu/kleros-core"
23+
),
24+
}}
25+
>
26+
<Routes>
27+
<Route path="/" element={<Layout />}>
28+
<Route index element={<Home />} />
29+
<Route path="cases" element={<h1>Cases</h1>} />
30+
<Route path="courts" element={<h1>Courts</h1>} />
31+
<Route path="dashboard" element={<h1>Dashboard</h1>} />
32+
<Route
33+
path="*"
34+
element={<h1>Justice not found here ¯\_( ͡° ͜ʖ ͡°)_/¯</h1>}
35+
/>
36+
</Route>
37+
</Routes>
38+
</SWRConfig>
39+
</StyledComponentsProvider>
40+
);
41+
};
2342

2443
export default App;
Lines changed: 10 additions & 0 deletions
Loading
Lines changed: 10 additions & 0 deletions
Loading

web/src/assets/svgs/icons/chat.svg

Lines changed: 10 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 5 additions & 0 deletions
Loading
Lines changed: 10 additions & 0 deletions
Loading

web/src/assets/svgs/icons/phone.svg

Lines changed: 5 additions & 0 deletions
Loading
Lines changed: 10 additions & 0 deletions
Loading

web/src/assets/svgs/icons/pnk.svg

Lines changed: 10 additions & 0 deletions
Loading
Lines changed: 34 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

web/src/assets/svgs/icons/user.svg

Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)