diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f66d1600ef..f5d502908a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -2,7 +2,7 @@ version: 2 updates: - package-ecosystem: "github-actions" directory: "/" - open-pull-requests-limit: 5 + open-pull-requests-limit: 8 target-branch: "dev" schedule: interval: "daily" @@ -11,7 +11,7 @@ updates: directory: "/" schedule: interval: "daily" - open-pull-requests-limit: 5 + open-pull-requests-limit: 8 target-branch: "dev" labels: - "npm" diff --git a/package.json b/package.json index 130a16f8b6..c71b9947e8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kwenta", - "version": "7.3.1", + "version": "7.3.2", "description": "Kwenta", "main": "index.js", "scripts": { @@ -32,24 +32,23 @@ ] }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "5.60.0", - "@typescript-eslint/parser": "5.60.0", - "eslint": "^8.43.0", - "eslint-config-prettier": "8.5.0", + "@typescript-eslint/eslint-plugin": "5.60.1", + "@typescript-eslint/parser": "5.60.1", + "eslint": "8.43.0", + "eslint-config-prettier": "8.8.0", "eslint-config-react-app": "7.0.1", - "eslint-plugin-chai-friendly": "^0.7.2", - "eslint-plugin-cypress": "^2.13.3", + "eslint-plugin-cypress": "2.13.3", "eslint-plugin-flowtype": "8.0.3", "eslint-plugin-import": "2.27.5", "eslint-plugin-jsx-a11y": "6.7.1", "eslint-plugin-prettier": "4.2.1", "eslint-plugin-react": "7.32.2", "eslint-plugin-react-hooks": "4.6.0", - "eslint-plugin-testing-library": "^5.11.0", - "eslint-plugin-ui-testing": "^2.0.1", - "husky": "8.0.1", - "lint-staged": "^13.0.3", - "prettier": "2.0.5", - "typescript": "^5.1.3" + "eslint-plugin-testing-library": "5.11.0", + "eslint-plugin-ui-testing": "2.0.1", + "husky": "8.0.3", + "lint-staged": "13.2.3", + "prettier": "2.8.8", + "typescript": "5.1.6" } } diff --git a/packages/app/package.json b/packages/app/package.json index 8a82b83290..b261f3e6f7 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@kwenta/app", - "version": "7.3.1", + "version": "7.3.2", "scripts": { "dev": "next", "build": "next build", @@ -27,35 +27,29 @@ "@gnosis.pm/safe-apps-sdk": "^7.8.0", "@kwenta/sdk": "workspace:*", "@material-ui/core": "^4.12.4", - "@metamask/detect-provider": "2.0.0", "@pythnetwork/pyth-evm-js": "1.17.0", "@rainbow-me/rainbowkit": "0.12.16", "@reach/dialog": "0.18.0", "@reduxjs/toolkit": "^1.9.5", - "@sentry/browser": "7.43.0", - "@sentry/tracing": "7.43.0", - "@socket.tech/plugin": "1.0.3", + "@sentry/browser": "7.57.0", + "@sentry/tracing": "7.57.0", + "@socket.tech/plugin": "1.0.14", "@synthetixio/optimism-networks": "2.74.6", "@synthetixio/wei": "2.74.4", - "@tanstack/react-table": "^8.9.2", + "@tanstack/react-table": "8.9.3", "@widgetbot/react-embed": "^1.7.0", "axios": "0.27.2", - "bignumber.js": "9.0.0", "codegen-graph-ts": "^0.1.4", "cors": "^2.8.5", "crypto-browserify": "^3.12.0", - "css-mediaquery": "^0.1.2", "date-fns": "2.21.3", "date-fns-tz": "1.3.7", "echarts": "5.4.2", "eslint-config-next": "^13.4.6", "ethcall": "4.7.2", - "ethereum-block-by-date": "^1.4.5", "ethers": "5.7.2", "graphql-request": "3.4.0", "i18next": "19.7.0", - "imagemin-mozjpeg": "^10.0.0", - "intercept-stdout": "^0.1.2", "isomorphic-dompurify": "^0.26.0", "lightweight-charts": "4.0.1", "lodash": "4.17.21", @@ -70,7 +64,7 @@ "react-infinite-scroll-component": "^6.1.0", "react-is": "^18.0.0", "react-query": "3.39.3", - "react-redux": "8.1.0", + "react-redux": "8.1.1", "react-responsive": "^9.0.2", "react-rnd": "^10.3.7", "react-select": "4.3.1", @@ -89,12 +83,12 @@ }, "devDependencies": { "@microsoft/eslint-formatter-sarif": "2.1.7", - "@next/eslint-plugin-next": "13.4.4", - "@storybook/addon-actions": "^7.0.22", - "@storybook/addon-essentials": "7.0.22", - "@storybook/addon-links": "^7.0.22", - "@storybook/nextjs": "^7.0.22", - "@storybook/react": "^7.0.22", + "@next/eslint-plugin-next": "13.4.7", + "@storybook/addon-actions": "7.0.24", + "@storybook/addon-essentials": "7.0.24", + "@storybook/addon-links": "7.0.24", + "@storybook/nextjs": "7.0.24", + "@storybook/react": "7.0.24", "@svgr/core": "5.5.0", "@svgr/webpack": "6.3.1", "@synthetixio/synpress": "3.7.1", @@ -108,9 +102,9 @@ "@types/date-fns": "2.6.0", "@types/ethereum-block-by-date": "^1.4.1", "@types/jest": "27.0.2", - "@types/lodash": "4.14.159", + "@types/lodash": "4.14.195", "@types/node": "14.0.13", - "@types/react": "18.2.13", + "@types/react": "18.2.14", "@types/react-dom": "18.2.6", "@types/react-responsive": "8.0.5", "@types/react-rnd": "^8.0.0", @@ -118,11 +112,11 @@ "@types/react-slick": "0.23.10", "@types/react-table": "7.0.22", "@types/redux-logger": "^3.0.9", - "@types/styled-components": "5.1.2", + "@types/styled-components": "5.1.26", "@types/testing-library__jest-dom": "^5.14.6", "css-loader": "^6.8.1", - "eslint-config-turbo": "^1.10.4", - "html-to-image": "1.11.4", + "eslint-config-turbo": "1.10.6", + "html-to-image": "1.11.11", "jest": "28.1.0", "jest-environment-jsdom": "28.1.0", "jest-preview": "^0.3.1", @@ -130,13 +124,11 @@ "next-router-mock": "0.9.3", "pinst": "3.0.0", "postcss": "^8.4.24", - "prettier": "2.0.5", + "prettier": "2.8.8", "react-test-renderer": "17.0.1", - "storybook": "^7.0.22", + "storybook": "7.0.24", "typechain": "8.1.1", - "typescript": "5.1.3", - "url-loader": "4.1.0", - "webp-loader": "0.6.0" + "typescript": "5.1.6" }, "engines": { "node": ">=16", diff --git a/packages/app/src/components/Button/Button.tsx b/packages/app/src/components/Button/Button.tsx index f445eafbbd..2d15ced91b 100644 --- a/packages/app/src/components/Button/Button.tsx +++ b/packages/app/src/components/Button/Button.tsx @@ -201,11 +201,11 @@ const BaseButton = styled.button` width: 100%; `}; - ${(props) => - props.$fontSize && - css` - font-size: ${props.$fontSize}px; - `} + ${(props) => + props.$fontSize && + css` + font-size: ${props.$fontSize}px; + `} &:disabled { color: ${(props) => props.theme.colors.selectedTheme.button.disabled.text}; diff --git a/packages/app/src/components/TVChart/TVChart.tsx b/packages/app/src/components/TVChart/TVChart.tsx index 26e2dd7e43..610bacc369 100644 --- a/packages/app/src/components/TVChart/TVChart.tsx +++ b/packages/app/src/components/TVChart/TVChart.tsx @@ -1,8 +1,11 @@ import { NetworkId, ConditionalOrder, PricesListener } from '@kwenta/sdk/types' import { formatOrderDisplayType, formatNumber } from '@kwenta/sdk/utils' import { + ChartingLibraryWidgetOptions, IChartingLibraryWidget, IPositionLineAdapter, + ResolutionString, + TimeFrameItem, widget, } from 'charting_library/charting_library' import { useRouter } from 'next/router' @@ -20,6 +23,7 @@ import darkTheme from 'styles/theme/colors/dark' import { DEFAULT_RESOLUTION } from './constants' import DataFeedFactory from './DataFeed' import { ChartPosition } from './types' +import { loadChartState, saveChartState } from './utils' export type ChartProps = { activePosition?: ChartPosition | null @@ -159,10 +163,12 @@ export function TVChart({ }, [showOrderLines]) useEffect(() => { - const widgetOptions = { + const chartData = loadChartState() + + const widgetOptions: ChartingLibraryWidgetOptions = { symbol: marketAsset + ':sUSD', datafeed: DataFeedFactory((network?.id ?? chain.optimism.id) as NetworkId, onSubscribe), - interval: interval, + interval: interval as ResolutionString, container: containerId, library_path: libraryPath, locale: 'en', @@ -177,7 +183,7 @@ export function TVChart({ fullscreen: fullscreen, autosize: autosize, studies_overrides: studiesOverrides, - theme: 'dark', + theme: 'Dark', custom_css_url: './theme.css', loading_screen: { backgroundColor: colors.selectedTheme.newTheme.containers.primary.background, @@ -191,7 +197,8 @@ export function TVChart({ { text: '5D', resolution: '15', description: '5 Days' }, { text: '30D', resolution: '1H', description: '30 Days' }, { text: '3M', resolution: '1H', description: '3 Months' }, - ], + ] as TimeFrameItem[], + saved_data: chartData, } const clearExistingWidget = () => { @@ -300,6 +307,18 @@ export function TVChart({ }) }, [marketAsset]) + useEffect(() => { + const handleAutoSave = () => { + _widget.current?.save(saveChartState) + } + + _widget.current?.subscribe('onAutoSaveNeeded', handleAutoSave) + + return () => { + _widget.current?.unsubscribe('onAutoSaveNeeded', handleAutoSave) + } + }, []) + const onSubscribe = useCallback((priceListener: PricesListener) => { _priceListener.current = priceListener }, []) diff --git a/packages/app/src/components/TVChart/constants.ts b/packages/app/src/components/TVChart/constants.ts index c9b7bf546a..ac41539279 100644 --- a/packages/app/src/components/TVChart/constants.ts +++ b/packages/app/src/components/TVChart/constants.ts @@ -1,3 +1,5 @@ import { ResolutionString } from 'charting_library/charting_library' export const DEFAULT_RESOLUTION: ResolutionString = '15' as ResolutionString + +export const TV_CHART_STATE = 'TV_CHART_STATE' diff --git a/packages/app/src/components/TVChart/utils.ts b/packages/app/src/components/TVChart/utils.ts index 998ea7954c..fc837731b2 100644 --- a/packages/app/src/components/TVChart/utils.ts +++ b/packages/app/src/components/TVChart/utils.ts @@ -1,5 +1,7 @@ import { ResolutionString } from 'charting_library/charting_library' +import { TV_CHART_STATE } from './constants' + export const resolutionToSeconds = (resolution: ResolutionString): number => { if (!isNaN(Number(resolution))) { return Number(resolution) * 60 @@ -26,3 +28,12 @@ export const getSupportedResolution = (period: number): string => { return '1' } } + +export const saveChartState = (state: object) => { + window.localStorage.setItem(TV_CHART_STATE, JSON.stringify(state)) +} + +export const loadChartState = () => { + const rawChartData = window.localStorage.getItem(TV_CHART_STATE) + return rawChartData ? JSON.parse(rawChartData) : undefined +} diff --git a/packages/app/src/components/TextToggle.tsx b/packages/app/src/components/TextToggle.tsx index 2f7eafe461..be7f672ca0 100644 --- a/packages/app/src/components/TextToggle.tsx +++ b/packages/app/src/components/TextToggle.tsx @@ -22,7 +22,11 @@ const TextToggle: React.FC> = ({ {title} {options.map((value) => ( - onOptionChange(value)}> + onOptionChange(value)} + > {value} ))} diff --git a/packages/app/src/hooks/useStatsData.ts b/packages/app/src/hooks/useStatsData.ts index 8ae61d9a07..56f47539f6 100644 --- a/packages/app/src/hooks/useStatsData.ts +++ b/packages/app/src/hooks/useStatsData.ts @@ -24,10 +24,8 @@ const useStatsData = () => { const prices = useAppSelector(selectMarkPrices) const minTimestamp = useAppSelector(selectMinTimestamp) - const { - data: dailyStatsData, - isLoading: dailyStatsIsLoading, - }: UseQueryResult = useGetFile('stats/daily_stats.json') + const { data: dailyStatsData, isLoading: dailyStatsIsLoading }: UseQueryResult = + useGetFile('stats/daily_stats.json') const openInterestData = useMemo(() => { return futuresMarkets.map(({ marketKey, asset, marketSize }) => { diff --git a/packages/app/src/pages/_app.tsx b/packages/app/src/pages/_app.tsx index d653e28830..a9c40a94c3 100644 --- a/packages/app/src/pages/_app.tsx +++ b/packages/app/src/pages/_app.tsx @@ -44,8 +44,7 @@ type AppPropsWithLayout = AppProps & { } Sentry.init({ - dsn: - 'https://d48644bc80d04977a26132b346417210@o4504363236851712.ingest.sentry.io/4504363261362177', + dsn: 'https://d48644bc80d04977a26132b346417210@o4504363236851712.ingest.sentry.io/4504363261362177', maxBreadcrumbs: 50, debug: process.env.NODE_ENV !== 'production', enabled: process.env.NODE_ENV === 'production', diff --git a/packages/app/src/pages/market.tsx b/packages/app/src/pages/market.tsx index 3c55c6a93a..cbe55008bb 100644 --- a/packages/app/src/pages/market.tsx +++ b/packages/app/src/pages/market.tsx @@ -147,10 +147,10 @@ function TradePanelDesktop() { const isolatedPositionsCount = useAppSelector(selectActiveIsolatedPositionsCount) const [open, setOpen] = useState(false) - useEffect(() => setOpen(accountType === 'isolated_margin' && isolatedPositionsCount === 0), [ - accountType, - isolatedPositionsCount, - ]) + useEffect( + () => setOpen(accountType === 'isolated_margin' && isolatedPositionsCount === 0), + [accountType, isolatedPositionsCount] + ) if (walletAddress && !isL2) { return diff --git a/packages/app/src/sections/dashboard/FuturesHistoryTable.tsx b/packages/app/src/sections/dashboard/FuturesHistoryTable.tsx index e0dc1b04bc..1688309d9e 100644 --- a/packages/app/src/sections/dashboard/FuturesHistoryTable.tsx +++ b/packages/app/src/sections/dashboard/FuturesHistoryTable.tsx @@ -122,7 +122,7 @@ const FuturesHistoryTable: FC = () => { { Header:
{t('dashboard.history.futures-history-table.market')}
, accessor: 'market', - Cell: (cellProps: CellProps) => { + Cell: (cellProps: CellProps<(typeof mappedHistoricalTrades)[number]>) => { return conditionalRender( cellProps.row.original.asset, <> @@ -251,7 +251,7 @@ const FuturesHistoryTable: FC = () => { { Header:
{t('dashboard.history.futures-history-table.asset')}
, accessor: 'displayAsset', - Cell: (cellProps: CellProps) => { + Cell: (cellProps: CellProps<(typeof mappedHistoricalTrades)[number]>) => { return conditionalRender( cellProps.row.original.asset, <> diff --git a/packages/app/src/sections/dashboard/FuturesMarketsTable.tsx b/packages/app/src/sections/dashboard/FuturesMarketsTable.tsx index f658fd8027..791ee44d93 100644 --- a/packages/app/src/sections/dashboard/FuturesMarketsTable.tsx +++ b/packages/app/src/sections/dashboard/FuturesMarketsTable.tsx @@ -104,7 +104,7 @@ const FuturesMarketsTable: React.FC = ({ search }) => {t('dashboard.overview.futures-markets-table.market')} ), accessor: 'market', - Cell: (cellProps: CellProps) => { + Cell: (cellProps: CellProps<(typeof data)[number]>) => { return ( @@ -135,7 +135,7 @@ const FuturesMarketsTable: React.FC = ({ search }) => ), accessor: 'price', - Cell: (cellProps: CellProps) => { + Cell: (cellProps: CellProps<(typeof data)[number]>) => { const formatOptions = { suggestDecimals: true, } @@ -163,7 +163,7 @@ const FuturesMarketsTable: React.FC = ({ search }) => ), accessor: 'priceChange', - Cell: (cellProps: CellProps) => { + Cell: (cellProps: CellProps<(typeof data)[number]>) => { return ( = ({ search }) => ), accessor: 'fundingRate', - Cell: (cellProps: CellProps) => { + Cell: (cellProps: CellProps<(typeof data)[number]>) => { return ( = ({ search }) => ), accessor: 'openInterest', - Cell: (cellProps: CellProps) => { + Cell: (cellProps: CellProps<(typeof data)[number]>) => { return ( = ({ search }) => ), accessor: 'dailyVolume', - Cell: (cellProps: CellProps) => { + Cell: (cellProps: CellProps<(typeof data)[number]>) => { return ( = ({ search }) => ), accessor: 'market', - Cell: (cellProps: CellProps) => { + Cell: (cellProps: CellProps<(typeof data)[number]>) => { return (
@@ -330,7 +330,7 @@ const FuturesMarketsTable: React.FC = ({ search }) =>
), accessor: 'openInterest', - Cell: (cellProps: CellProps) => { + Cell: (cellProps: CellProps<(typeof data)[number]>) => { return (
= ({ search }) =>
), accessor: 'dailyVolume', - Cell: (cellProps: CellProps) => { + Cell: (cellProps: CellProps<(typeof data)[number]>) => { return (
diff --git a/packages/app/src/sections/dashboard/FuturesPositionsTable/FuturesPositionsTable.tsx b/packages/app/src/sections/dashboard/FuturesPositionsTable/FuturesPositionsTable.tsx index 248c7098bc..6aa4c0828d 100644 --- a/packages/app/src/sections/dashboard/FuturesPositionsTable/FuturesPositionsTable.tsx +++ b/packages/app/src/sections/dashboard/FuturesPositionsTable/FuturesPositionsTable.tsx @@ -226,7 +226,7 @@ const FuturesPositionsTable: FC = ({ Header: TP/SL, accessor: 'tp-sl', // @ts-expect-error - Cell: (cellProps: CellProps) => { + Cell: (cellProps: CellProps<(typeof data)[number]>) => { return (
@@ -234,14 +234,20 @@ const FuturesPositionsTable: FC = ({ {NO_VALUE} ) : (
- +
)} {cellProps.row.original.stopLoss === undefined ? ( {NO_VALUE} ) : (
- +
)}
@@ -254,7 +260,7 @@ const FuturesPositionsTable: FC = ({ Header: Market Margin, accessor: 'margin', // @ts-expect-error - Cell: (cellProps: CellProps) => { + Cell: (cellProps: CellProps<(typeof data)[number]>) => { return (
diff --git a/packages/app/src/sections/dashboard/PortfolioChart.tsx b/packages/app/src/sections/dashboard/PortfolioChart.tsx index e7254cce8d..3e54456904 100644 --- a/packages/app/src/sections/dashboard/PortfolioChart.tsx +++ b/packages/app/src/sections/dashboard/PortfolioChart.tsx @@ -53,10 +53,8 @@ const PriceChart: FC = ({ setHoverValue, setHoverTitle }) => { const theme = useTheme() const portfolioTimeframe = useAppSelector(selectSelectedPortfolioTimeframe) const accountType = useAppSelector(selectFuturesType) - const { - isolated_margin: isolatedPortfolioData, - cross_margin: smartPortfolioData, - } = useAppSelector(selectPortfolioChartData) + const { isolated_margin: isolatedPortfolioData, cross_margin: smartPortfolioData } = + useAppSelector(selectPortfolioChartData) const portfolioData = useMemo( () => (accountType === 'isolated_margin' ? isolatedPortfolioData : smartPortfolioData), @@ -134,14 +132,11 @@ const PriceChart: FC = ({ setHoverValue, setHoverTitle }) => { const PortfolioChart: FC = () => { const { t } = useTranslation() - const { isolatedMarginFutures: isolatedTotal, crossMarginFutures: smartTotal } = useAppSelector( - selectFuturesPortfolio - ) + const { isolatedMarginFutures: isolatedTotal, crossMarginFutures: smartTotal } = + useAppSelector(selectFuturesPortfolio) const accountType = useAppSelector(selectFuturesType) - const { - isolated_margin: isolatedPortfolioData, - cross_margin: smartPortfolioData, - } = useAppSelector(selectPortfolioChartData) + const { isolated_margin: isolatedPortfolioData, cross_margin: smartPortfolioData } = + useAppSelector(selectPortfolioChartData) const buyingPower = useAppSelector(selectBuyingPower) const upnl = useAppSelector(selectTotalUnrealizedPnl) @@ -149,11 +144,10 @@ const PortfolioChart: FC = () => { const [hoverValue, setHoverValue] = useState(null) const [hoverTitle, setHoverTitle] = useState(null) - const total = useMemo(() => (accountType === 'isolated_margin' ? isolatedTotal : smartTotal), [ - accountType, - isolatedTotal, - smartTotal, - ]) + const total = useMemo( + () => (accountType === 'isolated_margin' ? isolatedTotal : smartTotal), + [accountType, isolatedTotal, smartTotal] + ) const portfolioData = useMemo(() => { return accountType === 'isolated_margin' ? isolatedPortfolioData : smartPortfolioData diff --git a/packages/app/src/sections/dashboard/RewardsTabs.tsx b/packages/app/src/sections/dashboard/RewardsTabs.tsx index f360cb1fb8..e4002607cb 100644 --- a/packages/app/src/sections/dashboard/RewardsTabs.tsx +++ b/packages/app/src/sections/dashboard/RewardsTabs.tsx @@ -76,11 +76,10 @@ const RewardsTabs: FC = () => { [estimatedOpQuery?.data?.claims, walletAddress] ) - const claimDisabledAll = useMemo(() => kwentaRewards.add(opRewards).add(snxOpRewards).lte(0), [ - opRewards, - snxOpRewards, - kwentaRewards, - ]) + const claimDisabledAll = useMemo( + () => kwentaRewards.add(opRewards).add(snxOpRewards).lte(0), + [opRewards, snxOpRewards, kwentaRewards] + ) const claimDisabledKwentaOp = useMemo(() => opRewards.lte(0), [opRewards]) diff --git a/packages/app/src/sections/dashboard/Stake/InputCards/RedeemInputCard.tsx b/packages/app/src/sections/dashboard/Stake/InputCards/RedeemInputCard.tsx index 8d89c031b9..4461e6f8c2 100644 --- a/packages/app/src/sections/dashboard/Stake/InputCards/RedeemInputCard.tsx +++ b/packages/app/src/sections/dashboard/Stake/InputCards/RedeemInputCard.tsx @@ -30,17 +30,15 @@ const RedeemInputCard: FC = ({ inputLabel, isVKwenta }) => const isVKwentaApproved = useAppSelector(selectIsVKwentaTokenApproved) const isVeKwentaApproved = useAppSelector(selectIsVeKwentaTokenApproved) - const isApproved = useMemo(() => (isVKwenta ? isVKwentaApproved : isVeKwentaApproved), [ - isVKwenta, - isVKwentaApproved, - isVeKwentaApproved, - ]) + const isApproved = useMemo( + () => (isVKwenta ? isVKwentaApproved : isVeKwentaApproved), + [isVKwenta, isVKwentaApproved, isVeKwentaApproved] + ) - const balance = useMemo(() => (isVKwenta ? vKwentaBalance : veKwentaBalance), [ - isVKwenta, - vKwentaBalance, - veKwentaBalance, - ]) + const balance = useMemo( + () => (isVKwenta ? vKwentaBalance : veKwentaBalance), + [isVKwenta, vKwentaBalance, veKwentaBalance] + ) const buttonTranslationKey = useMemo(() => { return isApproved diff --git a/packages/app/src/sections/exchange/FooterCard/SettleTransactionsCard.tsx b/packages/app/src/sections/exchange/FooterCard/SettleTransactionsCard.tsx index 6a9f77be3d..2057454307 100644 --- a/packages/app/src/sections/exchange/FooterCard/SettleTransactionsCard.tsx +++ b/packages/app/src/sections/exchange/FooterCard/SettleTransactionsCard.tsx @@ -18,19 +18,14 @@ import logError from 'utils/logError' const SettleTransactionsCard: FC = memo(() => { const { t } = useTranslation() - const { - baseCurrencyKey, - openModal, - numEntries, - settlementWaitingPeriod, - txError, - } = useAppSelector(({ exchange }) => ({ - baseCurrencyKey: exchange.baseCurrencyKey, - openModal: exchange.openModal, - numEntries: exchange.numEntries, - settlementWaitingPeriod: exchange.settlementWaitingPeriod, - txError: exchange.txError, - })) + const { baseCurrencyKey, openModal, numEntries, settlementWaitingPeriod, txError } = + useAppSelector(({ exchange }) => ({ + baseCurrencyKey: exchange.baseCurrencyKey, + openModal: exchange.openModal, + numEntries: exchange.numEntries, + settlementWaitingPeriod: exchange.settlementWaitingPeriod, + txError: exchange.txError, + })) const dispatch = useAppDispatch() const settlementDisabledReason = diff --git a/packages/app/src/sections/exchange/FooterCard/TradeSummaryCard.tsx b/packages/app/src/sections/exchange/FooterCard/TradeSummaryCard.tsx index d00498910d..17f9beb69e 100644 --- a/packages/app/src/sections/exchange/FooterCard/TradeSummaryCard.tsx +++ b/packages/app/src/sections/exchange/FooterCard/TradeSummaryCard.tsx @@ -84,9 +84,10 @@ const SubmissionButton = ({ onSubmit }: any) => { const isApproved = useAppSelector(selectIsApproved) const submissionDisabledReason = useAppSelector(selectSubmissionDisabledReason) - const isSubmissionDisabled = useMemo(() => submissionDisabledReason != null, [ - submissionDisabledReason, - ]) + const isSubmissionDisabled = useMemo( + () => submissionDisabledReason != null, + [submissionDisabledReason] + ) return (