From 6df5e721358c78c306dd630f94098cf3baca74ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Rodr=C3=ADguez=20Alsina?= Date: Mon, 17 Feb 2020 19:20:43 -0300 Subject: [PATCH] (Fix) Enforce linting and formatting (#564) * (remove) unused / old packages / linting script * (add) eslint / prettier packages and plugins * (fix) eslint / prettier config * (add) prettier / eslint scripts * (fix) linting and formatting problems * (remove) unused files * (fix) linting problem that needed to be addressed manually * (add) pre commit hooks * (fix) lint-staged config * (fix) config * (fix) config * (check) if pre config formatting works * Add nvmrc and update yarn.lock * Update `yarn.lock` * Make jsx-a11y/no-autofocus report as warn * Apply lint:fix to project Co-authored-by: Fernando --- .eslintignore | 14 +- .eslintrc | 133 +- .nvmrc | 1 + .prettierignore | 15 + .prettierrc | 9 +- package.json | 39 +- precommit.sh | 41 - .../layouts/ListContentLayout/List.jsx | 5 +- .../utils/modals/GenericModal/index.js | 10 +- src/components-v2/utils/modals/utils.js | 15 +- src/components/CookiesBanner/index.jsx | 8 +- src/components/EtherscanBtn/index.jsx | 4 +- src/components/EtherscanLink/index.jsx | 9 +- src/components/Footer/index.jsx | 39 +- .../Header/components/CircleDot.jsx | 7 +- src/components/Header/components/Layout.jsx | 87 +- .../Header/components/NetworkLabel.jsx | 3 +- src/components/Header/components/Provider.jsx | 7 +- .../ProviderDetails/UserDetails.jsx | 8 +- .../ProviderInfo/ProviderAccessible.jsx | 37 +- .../ProviderInfo/ProviderDisconnected.jsx | 17 +- .../components/SafeListHeader/index.jsx | 2 +- src/components/Header/index.jsx | 20 +- src/components/Identicon/index.jsx | 5 +- src/components/List/ListItemText/index.jsx | 22 +- src/components/Modal/index.jsx | 9 +- src/components/Notifier/index.js | 4 +- src/components/ScanQRModal/index.jsx | 15 +- src/components/ScanQRModal/style.js | 4 +- src/components/ScanQRModal/utils.js | 28 +- src/components/Sidebar/LegalLinks.jsx | 0 src/components/Sidebar/SafeList/index.jsx | 14 +- src/components/Sidebar/index.jsx | 17 +- src/components/Sidebar/style.js | 9 +- src/components/Spacer/index.jsx | 5 +- src/components/Stepper/Controls/index.jsx | 10 +- src/components/Stepper/OpenPaper/index.jsx | 4 +- src/components/Stepper/Step/index.jsx | 6 +- src/components/Stepper/index.jsx | 8 +- src/components/Table/TableHead.jsx | 4 +- src/components/Table/index.jsx | 9 +- src/components/Table/sorting.js | 9 +- src/components/forms/AddressInput/index.jsx | 16 +- src/components/forms/Checkbox/index.jsx | 15 +- src/components/forms/GnoForm/index.jsx | 6 +- src/components/forms/SelectField/index.jsx | 4 +- src/components/forms/TextField/index.jsx | 5 +- src/components/forms/TextareaField/index.jsx | 8 +- src/components/forms/validator.js | 18 +- src/components/hoc/OpenHoc.jsx | 11 +- src/components/layout/Block/index.jsx | 4 +- src/components/layout/Button/index.jsx | 4 +- src/components/layout/ButtonLink/index.jsx | 4 +- src/components/layout/Divider/index.js | 4 +- src/components/layout/Heading/index.jsx | 4 +- src/components/layout/Img/index.jsx | 4 +- src/components/layout/Link/index.jsx | 12 +- src/components/layout/Page/index.jsx | 6 +- src/components/layout/PageFrame/index.jsx | 2 +- src/components/layout/Paragraph/index.jsx | 4 +- src/components/layout/Row/index.jsx | 4 +- src/components/layout/Table/index.jsx | 10 +- src/logic/addressBook/model/addressBook.js | 8 +- .../store/actions/addAddressBookEntry.js | 10 +- .../store/actions/loadAddressBook.js | 4 +- .../actions/loadAddressBookFromStorage.js | 2 +- .../store/actions/removeAddressBookEntry.js | 1 - .../store/actions/updateAddressBookEntry.js | 10 +- .../store/middleware/addressBookMiddleware.js | 7 +- .../addressBook/store/reducer/addressBook.js | 36 +- .../addressBook/store/selectors/index.js | 6 +- src/logic/addressBook/utils/index.js | 8 +- .../cookies/store/actions/openCookieBanner.js | 4 +- .../api/fetchCurrenciesRates.js | 5 +- .../actions/fetchCurrencySelectedValue.js | 7 +- .../store/actions/fetchCurrencyValues.js | 23 +- .../store/actions/saveCurrencySelected.js | 5 +- .../store/actions/setCurrencyBalances.js | 6 +- .../store/actions/setCurrencySelected.js | 11 +- .../store/model/currencyValues.js | 7 +- .../currencyValues/store/selectors/index.js | 4 +- .../actions/loadCurrentSessionFromStorage.js | 2 +- .../store/model/currentSession.js | 4 +- .../store/reducer/currentSession.js | 10 +- src/logic/currentSession/utils/index.js | 3 +- .../notifications/notificationBuilder.js | 16 +- src/logic/notifications/notificationTypes.js | 9 +- .../store/reducer/notifications.js | 4 +- .../notifications/store/selectors/index.js | 4 +- src/logic/safe/safeTxSigner.js | 2 +- .../safe/transactions/awaitingTransactions.js | 42 +- src/logic/safe/transactions/gas.js | 2 +- src/logic/safe/transactions/gasNew.js | 13 +- src/logic/safe/utils/updateSafe.js | 7 +- .../store/actions/activateTokensByBalance.js | 32 +- src/logic/tokens/store/reducer/tokens.js | 4 +- src/logic/tokens/utils/tokenHelpers.js | 19 +- src/logic/tokens/utils/tokensStorage.js | 2 +- src/logic/wallets/ethAddresses.js | 3 +- src/logic/wallets/getWeb3.js | 12 +- .../wallets/store/actions/fetchProvider.js | 4 +- .../wallets/store/test/provider.reducer.js | 4 +- src/routes/index.js | 6 +- .../load/components/DetailsForm/index.jsx | 18 +- src/routes/load/components/Layout.jsx | 4 +- .../load/components/OwnerList/index.jsx | 45 +- .../components/ReviewInformation/index.jsx | 61 +- src/routes/load/container/Load.jsx | 17 +- src/routes/open/components/Layout.jsx | 18 +- .../components/ReviewInformation/index.jsx | 30 +- .../open/components/SafeNameForm/index.jsx | 22 +- .../SafeOwnersConfirmationsForm/index.jsx | 63 +- .../SafeOwnersConfirmationsForm/style.js | 9 +- src/routes/open/components/fields.js | 2 +- src/routes/open/container/Open.jsx | 23 +- src/routes/open/utils/safeDataExtractor.js | 8 +- src/routes/opening/component/index.jsx | 18 +- .../CreateEditEntryModal/index.jsx | 7 +- .../AddressBook/CreateEditEntryModal/style.js | 4 +- .../AddressBook/DeleteEntryModal/index.jsx | 18 +- .../AddressBook/DeleteEntryModal/style.js | 4 +- .../EllipsisTransactionDetails/index.jsx | 23 +- .../safe/components/AddressBook/columns.js | 1 - .../safe/components/AddressBook/index.jsx | 58 +- .../safe/components/AddressBook/style.js | 4 +- src/routes/safe/components/Apps/appsList.js | 4 +- .../components/Apps/confirmTransactions.js | 35 +- src/routes/safe/components/Apps/index.jsx | 37 +- .../safe/components/Apps/sendTransactions.js | 15 +- .../Balances/AssetTableCell/index.jsx | 4 +- .../components/Balances/Receive/index.jsx | 12 +- .../Balances/SendModal/SafeInfo/index.jsx | 8 +- .../components/Balances/SendModal/index.jsx | 8 +- .../screens/AddressBookInput/index.jsx | 18 +- .../screens/AddressBookInput/style.js | 2 +- .../SendModal/screens/ChooseTxType/index.jsx | 1 - .../SendModal/screens/ReviewCustomTx/style.js | 4 +- .../SendModal/screens/ReviewTx/index.jsx | 6 +- .../SendModal/screens/ReviewTx/style.js | 4 +- .../SendModal/screens/SendCustomTx/index.jsx | 75 +- .../SendFunds/TokenSelectField/index.jsx | 4 +- .../SendModal/screens/SendFunds/index.jsx | 90 +- .../safe/components/Balances/Tokens/index.jsx | 5 +- .../Tokens/screens/AddCustomToken/index.jsx | 12 +- .../screens/AddCustomToken/validators.js | 13 +- .../Tokens/screens/TokenList/TokenRow.jsx | 5 +- .../Tokens/screens/TokenList/index.jsx | 18 +- .../Tokens/screens/TokenList/style.js | 4 +- .../safe/components/Balances/dataFetcher.js | 30 +- src/routes/safe/components/Balances/index.jsx | 66 +- .../utils/setTokenImgToPlaceholder.js | 2 +- .../components/DropdownCurrency/index.jsx | 151 +- src/routes/safe/components/Layout.jsx | 40 +- src/routes/safe/components/NoRights/index.jsx | 7 +- .../ManageOwners/AddOwnerModal/index.jsx | 8 +- .../AddOwnerModal/screens/OwnerForm/index.jsx | 12 +- .../AddOwnerModal/screens/OwnerForm/style.js | 4 +- .../AddOwnerModal/screens/Review/index.jsx | 6 +- .../AddOwnerModal/screens/Review/style.js | 4 +- .../screens/ThresholdForm/index.jsx | 33 +- .../screens/ThresholdForm/style.js | 4 +- .../ManageOwners/EditOwnerModal/index.jsx | 2 +- .../ManageOwners/EditOwnerModal/style.js | 4 +- .../OwnerAddressTableCell/index.jsx | 12 +- .../ManageOwners/RemoveOwnerModal/index.jsx | 13 +- .../screens/CheckOwner/index.jsx | 6 +- .../screens/CheckOwner/style.js | 4 +- .../RemoveOwnerModal/screens/Review/index.jsx | 47 +- .../RemoveOwnerModal/screens/Review/style.js | 4 +- .../screens/ThresholdForm/index.jsx | 33 +- .../screens/ThresholdForm/style.js | 4 +- .../ManageOwners/ReplaceOwnerModal/index.jsx | 4 +- .../screens/OwnerForm/index.jsx | 12 +- .../screens/OwnerForm/style.js | 4 +- .../screens/Review/index.jsx | 47 +- .../ReplaceOwnerModal/screens/Review/style.js | 4 +- .../Settings/ManageOwners/index.jsx | 19 +- .../Settings/RemoveSafeModal/index.jsx | 15 +- .../components/Settings/SafeDetails/index.jsx | 17 +- .../ChangeThreshold/index.jsx | 10 +- .../ChangeThreshold/style.js | 4 +- .../Settings/ThresholdSettings/index.jsx | 16 +- .../Settings/ThresholdSettings/style.js | 4 +- .../Settings/UpdateSafeModal/index.jsx | 9 +- .../Settings/UpdateSafeModal/style.js | 4 +- .../Settings/assets/icons/OwnersIcon.jsx | 2 +- .../icons/RequiredConfirmationsIcon.jsx | 2 +- .../Settings/assets/icons/SafeDetailsIcon.jsx | 2 +- src/routes/safe/components/Settings/index.jsx | 35 +- .../ExpandedTx/ApproveTxModal/index.jsx | 29 +- .../ExpandedTx/ApproveTxModal/style.js | 4 +- .../IncomingTxDescription/index.jsx | 16 +- .../OwnersColumn/OwnerComponent.jsx | 11 +- .../ExpandedTx/OwnersColumn/OwnersList.jsx | 4 +- .../ExpandedTx/OwnersColumn/index.jsx | 102 +- .../TxsTable/ExpandedTx/OwnersColumn/style.js | 5 +- .../ExpandedTx/RejectTxModal/index.jsx | 7 +- .../ExpandedTx/RejectTxModal/style.js | 4 +- .../ExpandedTx/TxDescription/index.jsx | 95 +- .../TxsTable/ExpandedTx/index.jsx | 29 +- .../Transactions/TxsTable/ExpandedTx/style.js | 4 +- .../Transactions/TxsTable/Status/index.jsx | 6 +- .../Transactions/TxsTable/Status/style.js | 4 +- .../Transactions/TxsTable/TxType/index.jsx | 4 +- .../Transactions/TxsTable/columns.js | 7 +- .../Transactions/TxsTable/index.jsx | 16 +- .../components/assets/AddressBookIcon.jsx | 2 +- .../safe/components/assets/AppsIcon.jsx | 7 +- .../safe/components/assets/BalancesIcon.jsx | 2 +- .../safe/components/assets/SettingsIcon.jsx | 2 +- .../components/assets/TransactionsIcon.jsx | 2 +- src/routes/safe/components/style.js | 9 +- src/routes/safe/container/index.jsx | 16 +- src/routes/safe/container/selector.js | 94 +- .../safe/store/actions/createTransaction.js | 92 +- src/routes/safe/store/actions/fetchSafe.js | 61 +- .../safe/store/actions/fetchTokenBalances.js | 4 +- .../safe/store/actions/fetchTransactions.js | 129 +- .../safe/store/actions/processTransaction.js | 49 +- .../middleware/notificationsMiddleware.js | 39 +- .../safe/store/middleware/safeStorage.js | 9 +- src/routes/safe/store/models/safe.js | 4 +- src/routes/safe/store/reducer/safe.js | 53 +- src/routes/safe/store/selectors/index.js | 32 +- src/routes/welcome/components/Layout.jsx | 21 +- src/routes/welcome/container/index.jsx | 2 +- src/store/index.js | 29 +- src/theme/size.js | 4 +- src/utils/googleAnalytics.js | 4 +- src/utils/timer.js | 2 +- yarn.lock | 1281 +++++++++++------ 231 files changed, 2108 insertions(+), 2960 deletions(-) create mode 100644 .nvmrc create mode 100644 .prettierignore delete mode 100755 precommit.sh delete mode 100644 src/components/Sidebar/LegalLinks.jsx diff --git a/.eslintignore b/.eslintignore index 6c8e2095..d19b22ed 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,7 +1,15 @@ -node_modules +!.eslintrc.js build_webpack +config +contracts flow-typed flow-typed/npm -config -scripts migrations +node_modules +public +scripts +src/assets +src/config +test +*.spec* +*.test* \ No newline at end of file diff --git a/.eslintrc b/.eslintrc index 3c4d531a..3a5f43cb 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,82 +1,57 @@ { + "settings": { + "react": { + "flowVersion": "0.112.0", + "pragma": "React", + "version": "16.12.0" + }, + "import/extensions": [".js", ".jsx"] + }, + "parser": "babel-eslint", + "plugins": ["react", "flowtype", "import", "jsx-a11y", "prettier"], "extends": [ - "airbnb", + "eslint:recommended", + "plugin:react/recommended", "plugin:flowtype/recommended", + "plugin:import/errors", + "plugin:import/warnings", "plugin:jsx-a11y/recommended", "plugin:prettier/recommended", - "prettier/react" - ], - "parser": "babel-eslint", - "plugins": [ - "jsx-a11y", - "jest", - "flowtype" + "prettier/react", + "prettier/flowtype" ], + "parserOptions": { + "ecmaFeatures": { + "jsx": true + } + }, + "env": { + "browser": true, + "amd": true, + "node": true, + "es6": true + }, "rules": { - "react/jsx-filename-extension": [ - 1, - { - "extensions": [ - ".js", - ".jsx" - ] - } - ], - "react/forbid-prop-types": [ - 1, - { - "forbid": [ - "object", - "any" - ] - } - ], "class-methods-use-this": 0, - "semi": [ - "error", - "never" - ], - "consistent-return": "off", "max-len": [ "error", 120, 2, { - "ignoreUrls": true, "ignoreComments": false, "ignoreRegExpLiterals": true, "ignoreStrings": true, - "ignoreTemplateLiterals": true - } - ], - "import/no-unresolved": 0, - "import/no-extraneous-dependencies": 0, - "import/extensions": 0, - "import/prefer-default-export": 0, - "react/default-props-match-prop-types": [ - "error", - { - "allowRequiredDefaults": true - } - ], - // https://github.com/yannickcr/eslint-plugin-react/issues/1593 ^ - "jsx-a11y/label-has-for": 0, - "indent": [ - "error", - 2, - { - "SwitchCase": 1 + "ignoreTemplateLiterals": true, + "ignoreUrls": true } ], "no-console": [ "error", { - "allow": [ - "warn", - "error" - ] + "allow": ["warn", "error"] } ], + "semi": ["error", "never"], "flowtype/require-valid-file-annotation": [ 2, "always", @@ -84,32 +59,36 @@ "annotationStyle": "line" } ], - "flowtype/generic-spacing": 0, + "import/extensions": 0, + "import/no-extraneous-dependencies": 0, + "import/no-unresolved": 0, + "import/prefer-default-export": 0, "jsx-a11y/anchor-is-valid": [ "error", { - "components": [ - "Link" - ], - "specialLink": [ - "to", - "hrefLeft", - "hrefRight" - ], - "aspects": [ - "noHref", - "invalidHref", - "preferButton" - ] + "components": ["Link"], + "specialLink": ["to", "hrefLeft", "hrefRight"], + "aspects": ["noHref", "invalidHref", "preferButton"] + } + ], + "react/default-props-match-prop-types": ["error", { "allowRequiredDefaults": true }], + "react/forbid-prop-types": [ + 1, + { + "forbid": ["object", "any"] } ], - "react/require-default-props": 0, "react/no-array-index-key": 0, + "react/require-default-props": 0, + "react/state-in-constructor": 0, + "react/jsx-filename-extension": [ + 1, + { + "extensions": [".js", ".jsx"] + } + ], "react/jsx-props-no-spreading": 0, - "react/state-in-constructor": 0 - }, - "env": { - "jest/globals": true, - "browser": true + "prettier/prettier": "error", + "jsx-a11y/no-autofocus": "warn" } -} \ No newline at end of file +} diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000..f599e28b --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +10 diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..d19b22ed --- /dev/null +++ b/.prettierignore @@ -0,0 +1,15 @@ +!.eslintrc.js +build_webpack +config +contracts +flow-typed +flow-typed/npm +migrations +node_modules +public +scripts +src/assets +src/config +test +*.spec* +*.test* \ No newline at end of file diff --git a/.prettierrc b/.prettierrc index 66e7e941..e11ba81f 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,6 +1,7 @@ { - "trailingComma": "es5", "tabWidth": 2, - "semi": false, - "singleQuote": true -} \ No newline at end of file + "printWidth": 120, + "trailingComma": "all", + "singleQuote": true, + "semi": false +} diff --git a/package.json b/package.json index 1a0548a3..7cb40095 100644 --- a/package.json +++ b/package.json @@ -19,19 +19,27 @@ "build": "REACT_APP_APP_VERSION=$npm_package_version node scripts/build.js", "build-mainnet": "REACT_APP_NETWORK=mainnet yarn build", "flow": "flow", - "precommit": "./precommit.sh", + "format:staged": "lint-staged", + "lint:check": "eslint './src/**/*.{js,jsx}'", + "lint:fix": "yarn lint:check --fix", + "prettier": "prettier './src/**/*.{js,jsx}'", + "prettier:check": "yarn prettier --check", + "prettier:fix": "yarn prettier --write", "start": "node scripts/start.js", "start-mainnet": "REACT_APP_NETWORK=mainnet yarn start", - "test": "NODE_ENV=test && node scripts/test.js --env=jsdom", - "format": "prettier-eslint $PWD'/src/**/*.{js,jsx}' --write", - "format:staged": "lint-staged" + "test": "NODE_ENV=test && node scripts/test.js --env=jsdom" + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged --allow-empty" + } }, "lint-staged": { - "./src/**/*.{js,jsx}": "prettier-eslint --write" + "src/**/*.{js,jsx}": [ + "eslint --fix", + "prettier --write" + ] }, - "pre-commit": [ - "precommit" - ], "dependencies": { "@gnosis.pm/safe-contracts": "1.1.1-dev.1", "@gnosis.pm/util-contracts": "2.0.6", @@ -124,15 +132,13 @@ "css-loader": "3.4.0", "detect-port": "^1.3.0", "dotenv-expand": "^5.1.0", - "eslint": "6.7.2", - "eslint-config-airbnb": "18.0.1", + "eslint": "^6.8.0", "eslint-config-prettier": "^6.10.0", - "eslint-plugin-flowtype": "4.5.2", - "eslint-plugin-import": "2.19.1", - "eslint-plugin-jest": "23.1.1", - "eslint-plugin-jsx-a11y": "6.2.3", + "eslint-plugin-flowtype": "^4.6.0", + "eslint-plugin-import": "^2.20.1", + "eslint-plugin-jsx-a11y": "^6.2.3", "eslint-plugin-prettier": "^3.1.2", - "eslint-plugin-react": "7.17.0", + "eslint-plugin-react": "^7.18.3", "ethereumjs-abi": "0.6.8", "extract-text-webpack-plugin": "^4.0.0-beta.0", "file-loader": "5.0.2", @@ -140,6 +146,7 @@ "fs-extra": "8.1.0", "html-loader": "^0.5.5", "html-webpack-plugin": "^3.2.0", + "husky": "^4.2.2", "jest": "24.9.0", "jest-dom": "4.0.0", "json-loader": "^0.5.7", @@ -147,9 +154,7 @@ "postcss-loader": "^3.0.0", "postcss-mixins": "6.2.3", "postcss-simple-vars": "^5.0.2", - "pre-commit": "^1.2.2", "prettier": "^1.19.1", - "prettier-eslint-cli": "5.0.0", "run-with-testrpc": "0.3.1", "style-loader": "1.0.2", "terser-webpack-plugin": "2.3.1", diff --git a/precommit.sh b/precommit.sh deleted file mode 100755 index 4d646cc1..00000000 --- a/precommit.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx\{0,1\}$") -ESLINT="$(git rev-parse --show-toplevel)/node_modules/.bin/eslint" - -if [[ "$STAGED_FILES" = "" ]]; then - exit 0 -fi - -PASS=true - -echo -e "\nValidating Javascript:\n" - -# Check for eslint -if [[ ! -x "$ESLINT" ]]; then - echo -e "\t\033[41mPlease install ESlint\033[0m (npm i --save-dev eslint)" - exit 1 -fi - -for FILE in $STAGED_FILES -do - "$ESLINT" "$FILE" "--fix" - - if [[ "$?" == 0 ]]; then - echo -e "\t\033[32mESLint Passed: $FILE\033[0m" - else - echo -e "\t\033[41mESLint Failed: $FILE\033[0m" - PASS=false - fi -done - -echo -e "\nJavascript validation completed!\n" - -if ! $PASS; then - echo -e "\033[0;31mCOMMIT FAILED, PLEASE FIX ESLINT ERRORS:\033[0m Your commit contains files that should pass ESLint but do not. Please fix the ESLint errors in a new commit.\n" - exit 1 -else - echo -e "\033[42mCOMMIT SUCCEEDED\033[0m\n" -fi - -exit $? \ No newline at end of file diff --git a/src/components-v2/layouts/ListContentLayout/List.jsx b/src/components-v2/layouts/ListContentLayout/List.jsx index 9c49bcdb..29b87d98 100644 --- a/src/components-v2/layouts/ListContentLayout/List.jsx +++ b/src/components-v2/layouts/ListContentLayout/List.jsx @@ -40,10 +40,7 @@ const List = ({ items, activeItem, onItemClick, classes }: Props) => { {items.map(i => ( onItemClick(i.id)} >
diff --git a/src/components-v2/utils/modals/GenericModal/index.js b/src/components-v2/utils/modals/GenericModal/index.js index 213e6b6f..a2c25328 100644 --- a/src/components-v2/utils/modals/GenericModal/index.js +++ b/src/components-v2/utils/modals/GenericModal/index.js @@ -35,7 +35,7 @@ const useStyles = makeStyles(() => height: 'auto', position: 'static', }, - }) + }), ) type Props = { @@ -49,13 +49,7 @@ const GenericModal = ({ title, body, footer, onClose }: Props) => { const classes = useStyles() return ( - + {title} diff --git a/src/components-v2/utils/modals/utils.js b/src/components-v2/utils/modals/utils.js index 4380e1e4..4f12ea1c 100644 --- a/src/components-v2/utils/modals/utils.js +++ b/src/components-v2/utils/modals/utils.js @@ -20,13 +20,7 @@ const TitleWrapper = styled.div` align-items: center; ` -export const ModalTitle = ({ - title, - iconUrl, -}: { - title: string, - iconUrl: string, -}) => { +export const ModalTitle = ({ title, iconUrl }: { title: string, iconUrl: string }) => { return ( {iconUrl && } @@ -58,12 +52,7 @@ export const ModalFooterConfirmation = ({ - diff --git a/src/components/CookiesBanner/index.jsx b/src/components/CookiesBanner/index.jsx index c536ee2d..e78ef011 100644 --- a/src/components/CookiesBanner/index.jsx +++ b/src/components/CookiesBanner/index.jsx @@ -143,14 +143,12 @@ const CookiesBanner = () => {

- We use cookies to give you the best experience and to help improve our - website. Please read our{' '} + We use cookies to give you the best experience and to help improve our website. Please read our{' '} Cookie Policy {' '} - for more information. By clicking "Accept all", you agree to - the storing of cookies on your device to enhance site navigation, - analyze site usage and provide customer support. + for more information. By clicking "Accept all", you agree to the storing of cookies on your device + to enhance site navigation, analyze site usage and provide customer support.

diff --git a/src/components/EtherscanBtn/index.jsx b/src/components/EtherscanBtn/index.jsx index a924657c..70412948 100644 --- a/src/components/EtherscanBtn/index.jsx +++ b/src/components/EtherscanBtn/index.jsx @@ -33,9 +33,7 @@ type EtherscanBtnProps = { value: string, } -const EtherscanBtn = ({ - type, value, className, increaseZindex = false, -}: EtherscanBtnProps) => { +const EtherscanBtn = ({ type, value, className, increaseZindex = false }: EtherscanBtnProps) => { const classes = useStyles() const customClasses = increaseZindex ? { popper: classes.increasedPopperZindex } : {} diff --git a/src/components/EtherscanLink/index.jsx b/src/components/EtherscanLink/index.jsx index 53c3c10c..a68b30f7 100644 --- a/src/components/EtherscanLink/index.jsx +++ b/src/components/EtherscanLink/index.jsx @@ -18,14 +18,9 @@ type EtherscanLinkProps = { value: string, } -const EtherscanLink = ({ - type, value, cut, classes, knownAddress, -}: EtherscanLinkProps) => ( +const EtherscanLink = ({ type, value, cut, classes, knownAddress }: EtherscanLinkProps) => ( - + {cut ? shortVersionOf(value, cut) : value} diff --git a/src/components/Footer/index.jsx b/src/components/Footer/index.jsx index e0260fec..c1c10f40 100644 --- a/src/components/Footer/index.jsx +++ b/src/components/Footer/index.jsx @@ -42,9 +42,7 @@ const useStyles = makeStyles({ }, }) -const appVersion = process.env.REACT_APP_APP_VERSION - ? `v${process.env.REACT_APP_APP_VERSION} ` - : 'Versions' +const appVersion = process.env.REACT_APP_APP_VERSION ? `v${process.env.REACT_APP_APP_VERSION} ` : 'Versions' const Footer = () => { const date = new Date() @@ -59,50 +57,27 @@ const Footer = () => {