From 8d20fe4f44c76fae6b25803e7befdab1ad441b2a Mon Sep 17 00:00:00 2001 From: Sally MacFarlane Date: Thu, 2 Sep 2021 10:08:57 +1000 Subject: [PATCH] Update prettier to 2.3 (#240) * prettier 2.3.2 Signed-off-by: Sally MacFarlane --- package.json | 2 +- src/containers/Tabs/Account.tsx | 13 ++++-------- src/containers/Tabs/Admin.tsx | 13 ++++-------- src/containers/Tabs/useTransaction.ts | 7 ++++--- src/context/adminData.tsx | 30 +++++++++++---------------- yarn.lock | 7 +------ 6 files changed, 26 insertions(+), 46 deletions(-) diff --git a/package.json b/package.json index 36f3ecf..6d8b352 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "lint-staged": "11.1.2", "mocha-junit-reporter": "2.0.0", "mocha-multi-reporters": "^1.1.7", - "prettier": "2.2.1", + "prettier": "2.3.2", "solidity-coverage": "^0.7.1", "solium": "1.2.5", "truffle": "5.0.17", diff --git a/src/containers/Tabs/Account.tsx b/src/containers/Tabs/Account.tsx index a626d1c..d5a93c2 100644 --- a/src/containers/Tabs/Account.tsx +++ b/src/containers/Tabs/Account.tsx @@ -37,15 +37,10 @@ const AccountTabContainer: React.FC = ({ isOpen }) => const { isAdmin, dataReady: adminDataReady } = useAdminData(); const { allowlist, isReadOnly, dataReady, accountRulesContract } = useAccountData(); - const { - list, - modals, - toggleModal, - addTransaction, - updateTransaction, - deleteTransaction, - openToast - } = useTab(allowlist, (identifier: string) => ({ address: identifier })); + const { list, modals, toggleModal, addTransaction, updateTransaction, deleteTransaction, openToast } = useTab( + allowlist, + (identifier: string) => ({ address: identifier }) + ); if (!!accountRulesContract) { const handleAdd = async (value: string) => { diff --git a/src/containers/Tabs/Admin.tsx b/src/containers/Tabs/Admin.tsx index 4249410..8293376 100644 --- a/src/containers/Tabs/Admin.tsx +++ b/src/containers/Tabs/Admin.tsx @@ -34,15 +34,10 @@ type Admin = { const AdminTabContainer: React.FC = ({ isOpen }) => { const { admins, isAdmin, userAddress, dataReady, adminContract } = useAdminData(); - const { - list, - modals, - toggleModal, - addTransaction, - updateTransaction, - deleteTransaction, - openToast - } = useTab(admins || [], (identifier: string) => ({ address: identifier })); + const { list, modals, toggleModal, addTransaction, updateTransaction, deleteTransaction, openToast } = useTab( + admins || [], + (identifier: string) => ({ address: identifier }) + ); if (!!adminContract) { const handleAdd = async (value: string) => { diff --git a/src/containers/Tabs/useTransaction.ts b/src/containers/Tabs/useTransaction.ts index 49ac032..9c78b33 100644 --- a/src/containers/Tabs/useTransaction.ts +++ b/src/containers/Tabs/useTransaction.ts @@ -12,9 +12,10 @@ export default () => { }); }, []); - const updateTransaction = useCallback((identifier: string, status: string) => addTransaction(identifier, status), [ - addTransaction - ]); + const updateTransaction = useCallback( + (identifier: string, status: string) => addTransaction(identifier, status), + [addTransaction] + ); const deleteTransaction = useCallback((identifier: string) => { setTransactions(transactions => { diff --git a/src/context/adminData.tsx b/src/context/adminData.tsx index 41dc5d5..96ec5ff 100644 --- a/src/context/adminData.tsx +++ b/src/context/adminData.tsx @@ -40,14 +40,10 @@ export const AdminDataProvider: React.FC = (props: React.Props<{}>) => { const [adminContract, setAdminContract] = useState(undefined); const [userAddress, setUserAddress] = useState(undefined); - const value = useMemo(() => ({ admins, setAdmins, adminContract, setAdminContract, userAddress, setUserAddress }), [ - admins, - setAdmins, - adminContract, - setAdminContract, - userAddress, - setUserAddress - ]); + const value = useMemo( + () => ({ admins, setAdmins, adminContract, setAdminContract, userAddress, setUserAddress }), + [admins, setAdmins, adminContract, setAdminContract, userAddress, setUserAddress] + ); const { accountIngressContract, nodeIngressContract } = useNetwork(); @@ -113,17 +109,15 @@ export const useAdminData = () => { : undefined; }, [admins]); - const dataReady = useMemo(() => adminContract !== undefined && admins !== undefined && userAddress !== undefined, [ - adminContract, - admins, - userAddress - ]); + const dataReady = useMemo( + () => adminContract !== undefined && admins !== undefined && userAddress !== undefined, + [adminContract, admins, userAddress] + ); - const isAdmin = useMemo(() => (dataReady && admins ? admins.includes(userAddress!) : false), [ - dataReady, - admins, - userAddress - ]); + const isAdmin = useMemo( + () => (dataReady && admins ? admins.includes(userAddress!) : false), + [dataReady, admins, userAddress] + ); return { dataReady, diff --git a/yarn.lock b/yarn.lock index 17f0103..e06958b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11463,12 +11463,7 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5" - integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q== - -prettier@^2.1.2: +prettier@2.3.2, prettier@^2.1.2: version "2.3.2" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.2.tgz#ef280a05ec253712e486233db5c6f23441e7342d" integrity sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==