Skip to content

Feat(web): add Home page #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Jun 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
81ec927
feat(web): add StatDisplay component and start homepage dev
alcercu Apr 21, 2022
7b6ee39
fix(web): change tintMedium lightTheme to correct value
alcercu Apr 29, 2022
6dfac1b
feat(web): add Periods enum to constants
alcercu Apr 29, 2022
981ad1a
feat(web): add DisputeCard component
alcercu Apr 29, 2022
55ff603
chore(web): add icon svgs and remove fixed width and height
alcercu May 3, 2022
7dbecd6
fix(web): add css attributes to control svg size
alcercu May 3, 2022
3bd7c55
feat(web): populate stats cards with testnet data
alcercu May 3, 2022
0e79ba1
chore(web): modify browserlist to avoid build error and bump parcel v…
alcercu May 3, 2022
01060ee
chore(web): add queries path to the alias field
alcercu May 6, 2022
96ef137
feat(web): add home page chart
alcercu May 6, 2022
be8590c
refactor(web): use graphql typing to improve datapointquery
alcercu May 6, 2022
c2c9333
fix(web): increase z-index header
alcercu May 6, 2022
2be069f
chore: refactor code to acomodate new components version
alcercu May 9, 2022
5e4859e
fix: remove fill field from menu-icon svgs
alcercu May 9, 2022
152776f
chore: update @kleros/ui-components-library
alcercu May 10, 2022
b097d4f
fix(web): replace 100vw for 100% in header, footer and home to avoid …
alcercu May 10, 2022
a8a8393
fix(web): remove margin-top from title tags
alcercu May 10, 2022
92d0c19
refactor(web): organize home page directory
alcercu May 10, 2022
452a891
chore: remove explicit cache directory
alcercu May 10, 2022
64b46b7
refactor(web): unify homepage queries
alcercu May 12, 2022
a0e368f
feat(web): add Community section to homepage
alcercu Jun 2, 2022
2af569a
chore(web): update react typing packages and eslint
alcercu Jun 2, 2022
f695ab1
chore(web): update parcel and remove build browser restrictions
alcercu Jun 2, 2022
6144a6d
refactor(web): clean code smells
alcercu Jun 2, 2022
e19bbdd
Merge branch 'feat/web' into feat/add-homepage
alcercu Jun 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.4.1",
"eslint-plugin-promise": "^5.1.1",
"eslint-utils": "^3.0.0",
"husky": "^7.0.0",
"lint-staged": "^11.0.0",
"npm-run-all": "^4.1.5",
Expand Down
1 change: 0 additions & 1 deletion web/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
nodeLinker: node-modules
cacheFolder: $HOME/.yarn_cache

7 changes: 7 additions & 0 deletions web/codegen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
schema: https://api.thegraph.com/subgraphs/name/alcercu/kleros-core
documents: './src/hooks/queries/*.ts'
generates:
src/graphql/generated.ts:
plugins:
- typescript
- typescript-operations
2 changes: 1 addition & 1 deletion web/netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
NETLIFY_USE_YARN = "true"
NETLIFY_YARN_WORKSPACES = "true"
YARN_ENABLE_GLOBAL_CACHE = "true"
YARN_CACHE_FOLDER = "$HOME/.yarn_cache"
# YARN_CACHE_FOLDER = "$HOME/.yarn_cache"
# YARN_VERSION = "3.2.0"
37 changes: 26 additions & 11 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@kleros/kleros-v2-web",
"version": "0.1.0",
"source": "src/index.html",
"browserslist": "> 0.5%, last 2 versions, not dead, not ios_saf < 13",
"browserslist": "> 0.5%, not dead",
"repository": "",
"author": "",
"license": "MIT",
Expand All @@ -14,6 +14,7 @@
"layout": "./src/layout",
"consts": "./src/consts",
"hooks": "./src/hooks",
"queries": "./src/hooks/queries",
"pages": "./src/pages",
"styles": "./src/styles",
"svgs": "./src/assets/svgs"
Expand All @@ -25,36 +26,50 @@
"start": "parcel",
"build": "parcel build",
"check-style": "eslint 'src/**/*.{js,jsx,ts,tsx}'",
"check-types": "tsc --noEmit"
"check-types": "tsc --noEmit",
"generate": "graphql-codegen"
},
"devDependencies": {
"@parcel/transformer-svg-react": "^2.2.1",
"@types/react": "^17.0.38",
"@types/react-dom": "^17.0.11",
"@parcel/transformer-svg-react": "^2.5.0",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@types/styled-components": "^5.1.21",
"@typescript-eslint/eslint-plugin": "^5.10.1",
"@typescript-eslint/parser": "^5.10.1",
"eslint": "^8.7.0",
"@typescript-eslint/eslint-plugin": "^5.27.0",
"@typescript-eslint/parser": "^5.27.0",
"@typescript-eslint/utils": "^5.27.0",
"eslint": "^8.16.0",
"eslint-config-prettier": "^8.3.0",
"eslint-import-resolver-parcel": "^1.10.6",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-security": "^1.4.0",
"eslint-utils": "^3.0.0",
"lru-cache": "^7.8.0",
"parcel": "^2.4.1",
"parcel": "^2.6.0",
"prettier": "^2.5.1",
"typescript": "^4.5.5"
},
"dependencies": {
"@graphql-codegen/cli": "^2.6.2",
"@graphql-codegen/typescript": "^2.4.9",
"@graphql-codegen/typescript-operations": "^2.3.6",
"@kleros/kleros-v2-contracts": "workspace:^",
"@kleros/ui-components-library": "^0.1.5",
"@kleros/ui-components-library": "^1.1.0",
"chart.js": "^3.7.1",
"chartjs-adapter-moment": "^1.0.0",
"core-js": "^3.21.1",
"ethers": "^5.6.5",
"graphql": "^16.4.0",
"graphql-request": "^4.2.0",
"moment": "^2.29.3",
"react": "^18.0.0",
"react-chartjs-2": "^4.1.0",
"react-dom": "^18.0.0",
"react-is": "^18.0.0",
"react-router-dom": "6",
"styled-components": "^5.3.5"
"styled-components": "^5.3.5",
"swr": "^1.3.0"
}
}
53 changes: 36 additions & 17 deletions web/src/app.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,43 @@
import React from "react";
import { Routes, Route } from "react-router-dom";
import StyledComponentsProvider from "context/StyledComponentsProvider";
import { SWRConfig } from "swr";
import { request } from "graphql-request";
import { Routes, Route } from "react-router-dom";
import Layout from "layout/index";
import Home from "./pages/home";

const App: React.FC = () => (
<StyledComponentsProvider>
<Routes>
<Route path="/" element={<Layout />}>
<Route index element={<Home />} />
<Route path="cases" element={<h1>Cases</h1>} />
<Route path="courts" element={<h1>Courts</h1>} />
<Route path="dashboard" element={<h1>Dashboard</h1>} />
<Route
path="*"
element={<h1>Justice not found here ¯\_( ͡° ͜ʖ ͡°)_/¯</h1>}
/>
</Route>
</Routes>
</StyledComponentsProvider>
);
const fetcherBuilder =
(url: string) =>
({ query, variables }: { query: string; variables?: any }) => {
console.log("fetch");
return request(url, query, variables);
};

const App: React.FC = () => {
return (
<StyledComponentsProvider>
<SWRConfig
value={{
fetcher: fetcherBuilder(
"https://api.thegraph.com/subgraphs/name/alcercu/kleros-core"
),
}}
>
<Routes>
<Route path="/" element={<Layout />}>
<Route index element={<Home />} />
<Route path="cases" element={<h1>Cases</h1>} />
<Route path="courts" element={<h1>Courts</h1>} />
<Route path="dashboard" element={<h1>Dashboard</h1>} />
<Route
path="*"
element={<h1>Justice not found here ¯\_( ͡° ͜ʖ ͡°)_/¯</h1>}
/>
</Route>
</Routes>
</SWRConfig>
</StyledComponentsProvider>
);
};

export default App;
10 changes: 10 additions & 0 deletions web/src/assets/svgs/icons/bookmark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions web/src/assets/svgs/icons/calendar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions web/src/assets/svgs/icons/chat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions web/src/assets/svgs/icons/ethereum.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions web/src/assets/svgs/icons/french-flag.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions web/src/assets/svgs/icons/law-balance.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions web/src/assets/svgs/icons/phone.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions web/src/assets/svgs/icons/pile-coins.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions web/src/assets/svgs/icons/pnk.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions web/src/assets/svgs/icons/redistributed-pnk.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions web/src/assets/svgs/icons/snapshot-color.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions web/src/assets/svgs/icons/user.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading