Skip to content

feat: Initial web app for the court #69

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 88 commits into from
Jun 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
fdcafc1
feat(web): init court v2 directory
alcercu Apr 6, 2022
ecf5998
fix: package name
jaybuidl Apr 6, 2022
9e11c92
chore: yarn.lock update
jaybuidl Apr 6, 2022
ddd7960
chore: dependencies between packages, publication of the contracts pa…
jaybuidl Apr 7, 2022
78bd3e2
feat(web): add footer, header and socialmedia svgs
alcercu Apr 7, 2022
40366a2
chore(linter): deactivate unresolved import error to allow for parcel…
alcercu Apr 7, 2022
75e4a9f
fix: package.json browserslist typo
alcercu Apr 7, 2022
e513f66
feat(config): add parcel aliases for imports
alcercu Apr 7, 2022
e13628e
feat(dependencies): add kleros ui components and react router
alcercu Apr 7, 2022
8b1856c
feat(web): add routing
alcercu Apr 7, 2022
e3d4dd6
feat(web): add layout component
alcercu Apr 7, 2022
cd2b076
Merge branch 'feat/web' of github.com:kleros/kleros-v2 into feat/web
alcercu Apr 7, 2022
5049775
feat(web): improve use of router
AndreiMVP Apr 7, 2022
3782b3e
fix(config): endofline LF and small modification to eslint
AndreiMVP Apr 7, 2022
567968a
fix(web): add not ios_saf < 13 to browserslist
alcercu Apr 8, 2022
4cb5d2c
fix(web): add meta tag to avoid viewport resizing
alcercu Apr 8, 2022
ac9aff0
fix(web): add lru-cache as dev dependency to solve build error
alcercu Apr 8, 2022
90dd50e
fix(web): fixed router for ipfs deployment and absolute links
AndreiMVP Apr 8, 2022
ccae0a4
fix(dependencies): update kleros ui library version
alcercu Apr 8, 2022
29b0f93
feat(web/header): work in progress
alcercu Apr 8, 2022
81ae817
feat(web): add aliases to every src subdirectory
alcercu Apr 8, 2022
67d645f
Merge branch 'feat/web' into feat/add-header
alcercu Apr 8, 2022
9fc2063
fix(web): add core-js, fixes build error
alcercu Apr 11, 2022
ec70476
fix(web): tsconfig alias paths missing *
alcercu Apr 11, 2022
02449d3
feat(web/style): add color to text html tags on global style
alcercu Apr 11, 2022
4aa5101
feat(web/hooks): add useLocalStorage hook
alcercu Apr 11, 2022
7d7d6a4
feat(web/components): add LightButton
alcercu Apr 11, 2022
2268a90
feat(web): add StyledComponentsProvider and useToggleThemeContext to …
alcercu Apr 11, 2022
fed8103
feat(web): add navbar menu icons and implement theme switch
alcercu Apr 11, 2022
d79c770
feat(ci/cd): add netlify config file
alcercu Apr 11, 2022
945663c
chore: netlify configuration
jaybuidl Apr 11, 2022
38d021a
chore: fix netlify
jaybuidl Apr 11, 2022
938e56c
chore: fixing netlify again
jaybuidl Apr 11, 2022
0c3d1e2
chore: netlify
jaybuidl Apr 11, 2022
1a6ccd7
chore: move netlify.toml to web directory
alcercu Apr 11, 2022
f9713e3
chore: move cacheFolder option from env variable to rc file
alcercu Apr 11, 2022
ccac5a4
chore: bumped yarn to 3.2.0
jaybuidl Apr 11, 2022
ddadbf3
fix(web/netlify): set YARN_CACHE_FOLDER to netlify desired value
alcercu Apr 12, 2022
0fcdd38
fix(web/netlify): set cache folder in the rc file too
alcercu Apr 12, 2022
1a9e301
feat(web): add useFocusOutside
alcercu Apr 12, 2022
0fb5930
feat(web): add className prop to LightButton
alcercu Apr 12, 2022
c233024
fix(web): change width and height to 100% (from 100vh/vw)
alcercu Apr 12, 2022
ac44bc2
feat(web): make menu collapsible
alcercu Apr 12, 2022
41ea0fc
fix(web/netlify): add version field to workspaces
alcercu Apr 19, 2022
973fba7
Merge pull request #72 from kleros/fix/add-version-field-workspaces-p…
alcercu Apr 19, 2022
0a955b8
Merge branch 'feat/web' into feat/add-header
alcercu Apr 19, 2022
e5dbd75
chore(yarn.lock): update yarn.lock
alcercu Apr 19, 2022
9dcc2d2
feat(web/header): add kleros solutions icon
alcercu Apr 19, 2022
d5747dc
chore(web): add socialmedia links
alcercu Apr 21, 2022
b021335
refactor(web): simplify directory structure
alcercu Apr 21, 2022
c8058f0
Merge pull request #70 from kleros/feat/add-header
alcercu Apr 21, 2022
17973cd
fix(web): replace wrong lightError color and label text color
alcercu Apr 21, 2022
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
8f423f3
Merge branch 'master' into feat/web
alcercu Jun 2, 2022
e19bbdd
Merge branch 'feat/web' into feat/add-homepage
alcercu Jun 2, 2022
57e810c
Merge pull request #73 from kleros/feat/add-homepage
jaybuidl Jun 3, 2022
7f95612
Merge branch 'master' into feat/web
alcercu Jun 6, 2022
4920fc8
fix(web): remove svg presets from socialmedia icons and hamburger
alcercu Jun 6, 2022
be0658e
refactor(web): resolve toggleThemeContext smells
alcercu Jun 6, 2022
574b844
refactor(web): rename files and folders for more consistent naming
alcercu Jun 6, 2022
19e91ae
chore(web): add generated files to codeclimate exclude paths
alcercu Jun 6, 2022
1b5cfe9
refactor(web): improve home chart component
alcercu Jun 6, 2022
a7fcf5c
refactor(web): reduce code duplication in home page stats section
alcercu Jun 6, 2022
65f711a
fix(web): add explicit children typing to comply with react 18 types
alcercu Jun 6, 2022
d145e28
Merge branch 'master' into feat/web
alcercu Jun 8, 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
2 changes: 2 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ engines:
checks:
quotemark:
enabled: false
exclude_paths:
- "web/src/graphql/generated.ts"
785 changes: 785 additions & 0 deletions .yarn/releases/yarn-3.2.0.cjs

Large diffs are not rendered by default.

14 changes: 10 additions & 4 deletions contracts/.npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Exclude everything by default from the package
**/*
!/src/**
!/artifacts/@kleros/**
!/artifacts/src/**
!/deployments/*/*.json

# Include this
!/artifacts/**
!/typechain-types/**
!/deployments/**

# Except this
/deployments/localhost/
**/.DS_Store
7 changes: 4 additions & 3 deletions contracts/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@kleros/kleros-v2-contracts",
"version": "0.1.0",
"version": "0.1.1",
"description": "Smart contracts for Kleros version 2",
"main": "index.js",
"main": "typechain-types/index.ts",
"repository": "git@github.com:kleros/kleros-v2.git",
"author": "Kleros",
"license": "MIT",
Expand All @@ -17,7 +17,8 @@
"deploy:staging": "run-s \"deploy --network rinkeby {@}\" \"deploy --network arbitrumRinkeby {@}\" --",
"test": "hardhat test",
"watch": "hardhat watch",
"docgen": "hardhat docgen"
"docgen": "hardhat docgen",
"publish": "yarn npm publish --access public --tag $(cat package.json | jq .version)"
},
"devDependencies": {
"@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers@0.3.0-beta.13",
Expand Down
1 change: 1 addition & 0 deletions netlify.toml
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"subgraph",
"web"
],
"packageManager": "yarn@3.1.1",
"packageManager": "yarn@3.2.0",
"volta": {
"node": "16.15.1"
},
Expand All @@ -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
4 changes: 1 addition & 3 deletions subgraph/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"extends": "@graphprotocol/graph-ts/types/tsconfig.base.json",
"include": [
"src"
]
"include": ["src"]
}
11 changes: 11 additions & 0 deletions web/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8

[*.{js,jsx,ts,tsx,json,yml}]
indent_style = space
indent_size = 2
102 changes: 102 additions & 0 deletions web/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"env": {
"es6": true,
"browser": true,
"node": true
},
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:import/recommended",
"plugin:import/react",
"plugin:security/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"prettier"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"plugins": [
"react",
"react-hooks",
"security",
"import"
],
"ignorePatterns": [
"src/assets"
],
"settings": {
"react": {
"version": "^16.12.0"
},
"import/resolver": {
"parcel": {
"rootDir": "src",
"extensions": [
".js",
".jsx",
".ts",
".tsx",
".svg",
".png",
".jpeg"
]
}
}
},
"rules": {
"max-len": [
"warn",
{
"code": 80
}
],
"react/prop-types": 0,
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"varsIgnorePattern": "(^_+[0-9]*$)|([iI]gnored$)|(^ignored)",
"argsIgnorePattern": "(^_+[0-9]*$)|([iI]gnored$)|(^ignored)"
}
],
"no-console": [
"error",
{
"allow": [
"warn",
"error",
"info",
"debug"
]
}
],
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-explicit-any": "off",
"security/detect-object-injection": "off",
"security/detect-non-literal-fs-filename": "off",
"import/extensions": [
"error",
"ignorePackages",
{
"js": "never",
"jsx": "never",
"ts": "never",
"tsx": "never"
}
],
"import/no-unresolved": "off"
}
}
28 changes: 28 additions & 0 deletions web/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/.yarn/*
!/.yarn/versions
!/.yarn/plugins
!/.yarn/releases
!/.yarn/sdks
/.pnp.*
node_modules

# Parcel
.parcel-cache
development
build
dist
parcel-bundle-reports

# misc
.eslintcache
.DS_Store
.env
.env.test
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
6 changes: 6 additions & 0 deletions web/.parcelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "@parcel/config-default",
"transformers": {
"*.svg": ["...", "@parcel/transformer-svg-react"]
}
}
14 changes: 14 additions & 0 deletions web/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"printWidth": 80,
"endOfLine": "lf",
"overrides": [
{
"files": [
"*.json"
],
"options": {
"parser": "json-stringify"
}
}
]
}
2 changes: 2 additions & 0 deletions web/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
nodeLinker: node-modules

21 changes: 21 additions & 0 deletions web/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Kleros

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
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
15 changes: 15 additions & 0 deletions web/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {} from "styled-components";
import { lightTheme } from "./src/styles/themes";

declare global {
module "*.svg" {
const content: React.FC<React.SVGAttributes<SVGElement>>;
export default content;
}
}

declare module "styled-components" {
type Theme = typeof lightTheme;
//eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface DefaultTheme extends Theme {}
}
8 changes: 8 additions & 0 deletions web/netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Yarn 3 cache does not work out of the box as of Jan 2022. Context:
## https://github.com/netlify/build/issues/1535#issuecomment-1021947989
[build.environment]
NETLIFY_USE_YARN = "true"
NETLIFY_YARN_WORKSPACES = "true"
YARN_ENABLE_GLOBAL_CACHE = "true"
# YARN_CACHE_FOLDER = "$HOME/.yarn_cache"
# YARN_VERSION = "3.2.0"
75 changes: 75 additions & 0 deletions web/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"name": "@kleros/kleros-v2-web",
"version": "0.1.0",
"source": "src/index.html",
"browserslist": "> 0.5%, not dead",
"repository": "",
"author": "",
"license": "MIT",
"alias": {
"src": "./src",
"assets": "./src/assets",
"components": "./src/components",
"context": "./src/context",
"layout": "./src/layout",
"consts": "./src/consts",
"hooks": "./src/hooks",
"queries": "./src/hooks/queries",
"pages": "./src/pages",
"styles": "./src/styles",
"svgs": "./src/assets/svgs"
},
"packageManager": "yarn@3.2.0",
"scripts": {
"clear": "rm -r .parcel-cache",
"clean": "rm dist/bundle.js",
"start": "parcel",
"build": "parcel build",
"check-style": "eslint 'src/**/*.{js,jsx,ts,tsx}'",
"check-types": "tsc --noEmit",
"generate": "graphql-codegen"
},
"devDependencies": {
"@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.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.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": "^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",
"swr": "^1.3.0"
}
}
Loading