From bfb90786b1681c375f7fd727fbdbefb2afa0f931 Mon Sep 17 00:00:00 2001 From: katspaugh <381895+katspaugh@users.noreply.github.com> Date: Mon, 18 Apr 2022 10:12:51 +0200 Subject: [PATCH] Absolute imports alias @ --- components/balances/AssetsTable/index.tsx | 4 ++-- components/balances/CurrencySelect/index.tsx | 2 +- .../balances/CurrencySelect/useCurrencies.ts | 6 +++--- components/common/ChainIndicator/index.tsx | 4 ++-- components/common/DateTime/index.tsx | 2 +- components/common/FiatValue/index.tsx | 4 ++-- components/common/SafeHeader/index.tsx | 6 +++--- components/common/SafeList/index.tsx | 10 ++++----- .../common/Sidebar/Navigation/index.tsx | 4 ++-- components/common/Sidebar/index.tsx | 6 +++--- components/common/TokenAmount/index.tsx | 2 +- .../transactions/SignTxButton/index.tsx | 2 +- components/transactions/TxDateLabel/index.tsx | 2 +- components/transactions/TxInfo/index.tsx | 8 +++---- components/transactions/TxSummary/index.tsx | 4 ++-- components/tx/FinishTx/index.tsx | 6 +++--- components/tx/ReviewTx/index.tsx | 12 +++++------ components/tx/SendAssetsForm/index.tsx | 8 +++---- components/tx/SignProposedTx/index.tsx | 18 ++++++---------- components/tx/SignTx/index.tsx | 4 ++-- pages/404.tsx | 2 +- pages/_app.tsx | 20 +++++++++--------- pages/safe/balances/index.tsx | 6 +++--- pages/safe/transactions/history.tsx | 4 ++-- pages/safe/transactions/queue.tsx | 4 ++-- public/favicon.ico | Bin 25931 -> 110088 bytes services/createTransaction.ts | 2 +- services/proposeTransaction.ts | 4 ++-- services/useBalances.ts | 6 +++--- services/useBaseGas.ts | 2 +- services/useChains.ts | 4 ++-- services/useSafeAddress.ts | 2 +- services/useSafeInfo.ts | 4 ++-- services/useSafeSDK.ts | 6 +++--- services/useSafeTxGas.ts | 2 +- services/useTxHistory.ts | 6 +++--- services/useTxQueue.ts | 6 +++--- services/useWeb3.ts | 6 +++--- services/useWeb3ReadOnly.ts | 6 +++--- {utils => services}/web3.ts | 4 ++-- tsconfig.json | 8 +++---- 41 files changed, 107 insertions(+), 111 deletions(-) rename {utils => services}/web3.ts (95%) diff --git a/components/balances/AssetsTable/index.tsx b/components/balances/AssetsTable/index.tsx index ca958a6e22..7f653313ad 100644 --- a/components/balances/AssetsTable/index.tsx +++ b/components/balances/AssetsTable/index.tsx @@ -1,8 +1,8 @@ import { SafeBalanceResponse } from '@gnosis.pm/safe-react-gateway-sdk' import { Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow } from '@mui/material' import { ReactElement } from 'react' -import FiatValue from 'components/common/FiatValue' -import TokenAmount, { TokenIcon } from 'components/common/TokenAmount' +import FiatValue from '@/components/common/FiatValue' +import TokenAmount, { TokenIcon } from '@/components/common/TokenAmount' interface AssetsTableProps { items?: SafeBalanceResponse['items'] diff --git a/components/balances/CurrencySelect/index.tsx b/components/balances/CurrencySelect/index.tsx index 3b3e7cfd1c..64d43f75d4 100644 --- a/components/balances/CurrencySelect/index.tsx +++ b/components/balances/CurrencySelect/index.tsx @@ -1,7 +1,7 @@ import { ReactElement } from 'react' import { FormControl, InputLabel, MenuItem, Select, SelectChangeEvent } from '@mui/material' import { useAppDispatch, useAppSelector } from 'store' -import { selectCurrency, setCurrency } from 'store/currencySlice' +import { selectCurrency, setCurrency } from '@/store/currencySlice' import useCurriencies from './useCurrencies' import css from './styles.module.css' diff --git a/components/balances/CurrencySelect/useCurrencies.ts b/components/balances/CurrencySelect/useCurrencies.ts index 70511f2900..6cc076b23a 100644 --- a/components/balances/CurrencySelect/useCurrencies.ts +++ b/components/balances/CurrencySelect/useCurrencies.ts @@ -1,8 +1,8 @@ import { useEffect } from 'react' import { getFiatCurrencies, FiatCurrencies } from '@gnosis.pm/safe-react-gateway-sdk' -import { GATEWAY_URL } from 'config/constants' -import useAsync from 'services/useAsync' -import { Errors, logError } from 'services/exceptions' +import { GATEWAY_URL } from '@/config/constants' +import useAsync from '@/services/useAsync' +import { Errors, logError } from '@/services/exceptions' const fetchCurrencies = () => { return getFiatCurrencies(GATEWAY_URL) diff --git a/components/common/ChainIndicator/index.tsx b/components/common/ChainIndicator/index.tsx index e83b5363c9..cee8076415 100644 --- a/components/common/ChainIndicator/index.tsx +++ b/components/common/ChainIndicator/index.tsx @@ -1,7 +1,7 @@ import { ReactElement, useMemo } from 'react' -import useSafeAddress from 'services/useSafeAddress' +import useSafeAddress from '@/services/useSafeAddress' import { useAppSelector } from 'store' -import { selectChainById } from 'store/chainsSlice' +import { selectChainById } from '@/store/chainsSlice' const ChainIndicator = (): ReactElement => { const { chainId } = useSafeAddress() diff --git a/components/common/DateTime/index.tsx b/components/common/DateTime/index.tsx index c6a2975f77..5e4a31cd13 100644 --- a/components/common/DateTime/index.tsx +++ b/components/common/DateTime/index.tsx @@ -1,5 +1,5 @@ import { ReactElement, useMemo } from 'react' -import useBrowserLocale from 'services/useBrowserLocale' +import useBrowserLocale from '@/services/useBrowserLocale' const DateTime = ({ value, diff --git a/components/common/FiatValue/index.tsx b/components/common/FiatValue/index.tsx index 6839a1f879..5580ae1af8 100644 --- a/components/common/FiatValue/index.tsx +++ b/components/common/FiatValue/index.tsx @@ -1,7 +1,7 @@ import { ReactElement, useMemo } from 'react' -import useBrowserLocale from 'services/useBrowserLocale' +import useBrowserLocale from '@/services/useBrowserLocale' import { useAppSelector } from 'store' -import { selectCurrency } from 'store/currencySlice' +import { selectCurrency } from '@/store/currencySlice' const FiatValue = ({ value }: { value: string | number }): ReactElement => { const locale = useBrowserLocale() diff --git a/components/common/SafeHeader/index.tsx b/components/common/SafeHeader/index.tsx index ecd64827a4..4045099008 100644 --- a/components/common/SafeHeader/index.tsx +++ b/components/common/SafeHeader/index.tsx @@ -1,8 +1,8 @@ import { ReactElement } from 'react' import { connect } from 'react-redux' -import { shortenAddress } from 'services/formatters' -import { selectBalances } from 'store/balancesSlice' -import { selectSafeInfo } from 'store/safeInfoSlice' +import { shortenAddress } from '@/services/formatters' +import { selectBalances } from '@/store/balancesSlice' +import { selectSafeInfo } from '@/store/safeInfoSlice' import { RootState } from '../../../store' import FiatValue from '../FiatValue' import Identicon from '../Identicon' diff --git a/components/common/SafeList/index.tsx b/components/common/SafeList/index.tsx index 3bbf9b3e9c..e6c088b564 100644 --- a/components/common/SafeList/index.tsx +++ b/components/common/SafeList/index.tsx @@ -1,13 +1,13 @@ import { getOwnedSafes, OwnedSafes } from '@gnosis.pm/safe-react-gateway-sdk' import Web3 from 'web3' -import { GATEWAY_URL } from 'config/constants' +import { GATEWAY_URL } from '@/config/constants' import { ReactElement } from 'react' -import useAsync from 'services/useAsync' +import useAsync from '@/services/useAsync' import css from './styles.module.css' import Link from 'next/link' -import chains from 'config/chains' -import useSafeAddress from 'services/useSafeAddress' -import { shortenAddress } from 'services/formatters' +import chains from '@/config/chains' +import useSafeAddress from '@/services/useSafeAddress' +import { shortenAddress } from '@/services/formatters' const getOwned = (chainId: string, walletAddress: string): Promise => { return getOwnedSafes(GATEWAY_URL, chainId, walletAddress) diff --git a/components/common/Sidebar/Navigation/index.tsx b/components/common/Sidebar/Navigation/index.tsx index 6b5b7f9271..1323482c6a 100644 --- a/components/common/Sidebar/Navigation/index.tsx +++ b/components/common/Sidebar/Navigation/index.tsx @@ -7,8 +7,8 @@ import ExpandLess from '@mui/icons-material/ExpandLess' import ExpandMore from '@mui/icons-material/ExpandMore' import List from '@mui/material/List' -import useSafeAddress from 'services/useSafeAddress' -import chains from 'config/chains' +import useSafeAddress from '@/services/useSafeAddress' +import chains from '@/config/chains' import { useRouter } from 'next/router' type NavItem = { diff --git a/components/common/Sidebar/index.tsx b/components/common/Sidebar/index.tsx index 2008e68560..a6222ac043 100644 --- a/components/common/Sidebar/index.tsx +++ b/components/common/Sidebar/index.tsx @@ -2,14 +2,14 @@ import { ReactElement, useState } from 'react' import { Button } from '@mui/material' import { useAppSelector } from 'store' -import { selectSafeInfo } from 'store/safeInfoSlice' +import { selectSafeInfo } from '@/store/safeInfoSlice' import ChainIndicator from '../ChainIndicator' import SafeHeader from '../SafeHeader' import SafeList from '../SafeList' import ErrorToast from '../ErrorToast' import css from './styles.module.css' -import TxModal from 'components/tx/TxModal' -import Navigation from 'components/common/Sidebar/Navigation' +import TxModal from '@/components/tx/TxModal' +import Navigation from '@/components/common/Sidebar/Navigation' const Sidebar = (): ReactElement => { const [txOpen, setTxOpen] = useState(false) diff --git a/components/common/TokenAmount/index.tsx b/components/common/TokenAmount/index.tsx index 0b4820d4b7..b9c7c4e8d4 100644 --- a/components/common/TokenAmount/index.tsx +++ b/components/common/TokenAmount/index.tsx @@ -1,6 +1,6 @@ import { type ReactElement } from 'react' import { TransferDirection } from '@gnosis.pm/safe-react-gateway-sdk' -import { formatDecimals } from 'services/formatters' +import { formatDecimals } from '@/services/formatters' import css from './styles.module.css' export const TokenIcon = (props: { logoUri?: string | null; tokenSymbol?: string | null }): ReactElement | null => { diff --git a/components/transactions/SignTxButton/index.tsx b/components/transactions/SignTxButton/index.tsx index 4779d5055f..fc7b9bf6d1 100644 --- a/components/transactions/SignTxButton/index.tsx +++ b/components/transactions/SignTxButton/index.tsx @@ -1,6 +1,6 @@ import { type TransactionSummary } from '@gnosis.pm/safe-react-gateway-sdk' import { Button } from '@mui/material' -import TxModal from 'components/tx/TxModal' +import TxModal from '@/components/tx/TxModal' import { useState, type ReactElement } from 'react' import css from './styles.module.css' diff --git a/components/transactions/TxDateLabel/index.tsx b/components/transactions/TxDateLabel/index.tsx index 17242ac1f8..f77c232346 100644 --- a/components/transactions/TxDateLabel/index.tsx +++ b/components/transactions/TxDateLabel/index.tsx @@ -1,5 +1,5 @@ import { DateLabel } from '@gnosis.pm/safe-react-gateway-sdk' -import DateTime from 'components/common/DateTime' +import DateTime from '@/components/common/DateTime' import { ReactElement } from 'react' import css from './styles.module.css' diff --git a/components/transactions/TxInfo/index.tsx b/components/transactions/TxInfo/index.tsx index 0f0864b3f0..1fd2afa76d 100644 --- a/components/transactions/TxInfo/index.tsx +++ b/components/transactions/TxInfo/index.tsx @@ -9,10 +9,10 @@ import { TransferDirection, } from '@gnosis.pm/safe-react-gateway-sdk' import { useAppSelector } from 'store' -import { selectChainById } from 'store/chainsSlice' -import useSafeAddress from 'services/useSafeAddress' -import TokenAmount from 'components/common/TokenAmount' -import { shortenAddress } from 'services/formatters' +import { selectChainById } from '@/store/chainsSlice' +import useSafeAddress from '@/services/useSafeAddress' +import TokenAmount from '@/components/common/TokenAmount' +import { shortenAddress } from '@/services/formatters' const TransferTx = ({ info }: { info: Transfer }): ReactElement => { const { chainId } = useSafeAddress() diff --git a/components/transactions/TxSummary/index.tsx b/components/transactions/TxSummary/index.tsx index eb624a895a..a1167cdbf3 100644 --- a/components/transactions/TxSummary/index.tsx +++ b/components/transactions/TxSummary/index.tsx @@ -1,10 +1,10 @@ import { type ReactElement } from 'react' import { MultisigExecutionInfo, Transaction, TransactionStatus } from '@gnosis.pm/safe-react-gateway-sdk' import { Grid, Paper } from '@mui/material' -import DateTime from 'components/common/DateTime' +import DateTime from '@/components/common/DateTime' import css from './styles.module.css' import TxInfo from '../TxInfo' -import { useWalletAddress } from 'services/useSafeSDK' +import { useWalletAddress } from '@/services/useSafeSDK' import SignTxButton from '../SignTxButton' type TxSummaryProps = { diff --git a/components/tx/FinishTx/index.tsx b/components/tx/FinishTx/index.tsx index a179f4c0e0..f694151765 100644 --- a/components/tx/FinishTx/index.tsx +++ b/components/tx/FinishTx/index.tsx @@ -1,9 +1,9 @@ import { type SafeTransaction } from '@gnosis.pm/safe-core-sdk-types' import { Typography } from '@mui/material' -import ErrorToast from 'components/common/ErrorToast' +import ErrorToast from '@/components/common/ErrorToast' import { useEffect, useState, type ReactElement } from 'react' -import proposeTx from 'services/proposeTransaction' -import useSafeAddress from 'services/useSafeAddress' +import proposeTx from '@/services/proposeTransaction' +import useSafeAddress from '@/services/useSafeAddress' import css from './styles.module.css' const FinishTx = ({ tx }: { tx: SafeTransaction }): ReactElement => { diff --git a/components/tx/ReviewTx/index.tsx b/components/tx/ReviewTx/index.tsx index 2777f85858..82a8df80cd 100644 --- a/components/tx/ReviewTx/index.tsx +++ b/components/tx/ReviewTx/index.tsx @@ -3,15 +3,15 @@ import { type SafeTransaction } from '@gnosis.pm/safe-core-sdk-types' import { type TokenInfo } from '@gnosis.pm/safe-react-gateway-sdk' import { type SendAssetsFormData } from '../SendAssetsForm' import { Button, FormControl, TextField, Typography } from '@mui/material' -import { TokenIcon } from 'components/common/TokenAmount' -import { createTokenTransferParams, createTransaction } from 'services/createTransaction' -import { shortenAddress } from 'services/formatters' +import { TokenIcon } from '@/components/common/TokenAmount' +import { createTokenTransferParams, createTransaction } from '@/services/createTransaction' +import { shortenAddress } from '@/services/formatters' import { useAppSelector } from 'store' -import { selectBalances } from 'store/balancesSlice' +import { selectBalances } from '@/store/balancesSlice' import { useForm, type FieldValues } from 'react-hook-form' import css from './styles.module.css' -import ErrorToast from 'components/common/ErrorToast' -import useSafeTxGas from 'services/useSafeTxGas' +import ErrorToast from '@/components/common/ErrorToast' +import useSafeTxGas from '@/services/useSafeTxGas' const TokenTransferReview = ({ params, tokenInfo }: { params: SendAssetsFormData; tokenInfo: TokenInfo }) => { return ( diff --git a/components/tx/SendAssetsForm/index.tsx b/components/tx/SendAssetsForm/index.tsx index 9f86e37f45..620a8b17cf 100644 --- a/components/tx/SendAssetsForm/index.tsx +++ b/components/tx/SendAssetsForm/index.tsx @@ -4,10 +4,10 @@ import { useForm, type FieldValues } from 'react-hook-form' import css from './styles.module.css' import { useAppSelector } from 'store' -import { selectBalances } from 'store/balancesSlice' -import TokenAmount, { TokenIcon } from 'components/common/TokenAmount' -import { formatDecimals, toDecimals } from 'services/formatters' -import { validateAddress } from 'services/validation' +import { selectBalances } from '@/store/balancesSlice' +import TokenAmount, { TokenIcon } from '@/components/common/TokenAmount' +import { formatDecimals, toDecimals } from '@/services/formatters' +import { validateAddress } from '@/services/validation' export type SendAssetsFormData = { recepient: string diff --git a/components/tx/SignProposedTx/index.tsx b/components/tx/SignProposedTx/index.tsx index caad008d00..9acdfe0cec 100644 --- a/components/tx/SignProposedTx/index.tsx +++ b/components/tx/SignProposedTx/index.tsx @@ -1,12 +1,12 @@ import { type SafeTransaction } from '@gnosis.pm/safe-core-sdk-types' import { getTransactionDetails, TransactionSummary } from '@gnosis.pm/safe-react-gateway-sdk' import { Button, Typography } from '@mui/material' -import ErrorToast from 'components/common/ErrorToast' -import { GATEWAY_URL } from 'config/constants' +import ErrorToast from '@/components/common/ErrorToast' +import { GATEWAY_URL } from '@/config/constants' import { ReactElement, useState } from 'react' -import { createTransaction, signTransaction } from 'services/createTransaction' -import extractTxInfo from 'services/extractTxInfo' -import useSafeAddress from 'services/useSafeAddress' +import { createTransaction, signTransaction } from '@/services/createTransaction' +import extractTxInfo from '@/services/extractTxInfo' +import useSafeAddress from '@/services/useSafeAddress' import css from './styles.module.css' const getTxDetails = async (chainId: string, id: string) => { @@ -44,12 +44,8 @@ const SignProposedTx = ({
Confirm transaction -
- Transaction id -
-
-        {txSummary.id}
-      
+
Transaction id
+
{txSummary.id}