Skip to content

Commit

Permalink
fix: add missing dependencies to all hooks and add eslint react hooks…
Browse files Browse the repository at this point in the history
… rules (#49)

* fix: add missing dependencies to all hooks and add eslint react hooks rules

* chore: remove unused imports automatically by eslint (--quiet has been removed)

* feat: my exchanges/disputes: always show status label

* refactor: remove unused prop

* feat: update wallet list & fix modal position

* feat: show buyer/seller toggle in exchange if you are both the seller and the buyer

* feat: f you click on one of your exchanges and then go back, you should see the my exchanges tab, not the default tab (my offers)

* style: make ipfs url fit in custom store modal

* fix: performance bug in explore page

* fix: redirect to first page by mistake if you go directly and there are offers

* refactor: use useInfiniteQuery to get offers in account and reestructure some files in useOffers folder

* feat: add status labels to account exchange/offer details/account offers pages

* refactor: isAccountSeller

* fix: exchange state labels

Co-authored-by: Rafał Mikucki <[email protected]>
  • Loading branch information
albertfolch-redeemeum and bigerjot authored Jun 27, 2022
1 parent 1214b97 commit 35e3544
Show file tree
Hide file tree
Showing 42 changed files with 624 additions and 308 deletions.
7 changes: 5 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@
"ecmaVersion": 2021,
"sourceType": "module"
},
"plugins": ["react", "@typescript-eslint", "react-hooks", "simple-import-sort"],
"plugins": ["react", "@typescript-eslint", "react-hooks", "simple-import-sort", "unused-imports"],
"rules": {
"simple-import-sort/exports": "error",
"unused-imports/no-unused-imports": "warn",
"simple-import-sort/imports": "error",
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
}
]
],
"react-hooks/rules-of-hooks": "error", // Checks rules of Hooks
"react-hooks/exhaustive-deps": "error" // Checks effect dependencies
},
"extends": [
"eslint:recommended",
Expand Down
126 changes: 86 additions & 40 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dev": "react-app-rewired start",
"build": "react-app-rewired build",
"eject": "react-app-rewired eject",
"lint": "eslint --ignore-path ./.gitignore --ext .js,.ts,.tsx . --quiet --fix",
"lint": "eslint --ignore-path ./.gitignore --ext .js,.ts,.tsx . --fix",
"prettier": "prettier --write \"src/**/*.{ts,tsx}\"",
"prepare": "husky install",
"test": "react-app-rewired test --testPathIgnorePatterns .spec.ts",
Expand All @@ -26,10 +26,10 @@
"postinstall": "npx playwright install --with-deps chromium"
},
"dependencies": {
"@bosonprotocol/common": "^1.6.0-alpha.11",
"@bosonprotocol/core-sdk": "^1.6.0-alpha.11",
"@bosonprotocol/ipfs-storage": "^1.5.0-alpha.11",
"@bosonprotocol/widgets-sdk": "^1.6.0-alpha.11",
"@bosonprotocol/common": "^1.6.0",
"@bosonprotocol/core-sdk": "^1.7.1-alpha.0",
"@bosonprotocol/ipfs-storage": "^1.5.0",
"@bosonprotocol/widgets-sdk": "^1.6.0",
"@davatar/react": "^1.10.3",
"@ethersproject/address": "^5.6.0",
"@ethersproject/units": "^5.6.0",
Expand Down Expand Up @@ -78,6 +78,7 @@
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-react-hooks": "^4.5.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"eslint-plugin-unused-imports": "^2.0.0",
"husky": "^7.0.4",
"istanbul": "^0.4.5",
"nyc": "^15.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/components/header/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function Account({ connect, isConnected }: Props) {
if (isConnected && isClicked) {
navigate({ pathname: BosonRoutes.YourAccount });
}
}, [isConnected, isClicked]);
}, [isConnected, isClicked, navigate]);
return (
<AccountSvgIcon
data-testid="account"
Expand Down
2 changes: 1 addition & 1 deletion src/components/modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { IoIosClose } from "react-icons/io";
import styled from "styled-components";

const Root = styled.div`
position: absolute;
position: fixed;
top: 0;
bottom: 0;
left: 0;
Expand Down
Loading

0 comments on commit 35e3544

Please sign in to comment.