diff --git a/src/components/DraftOrdersTab.tsx b/src/components/DraftOrdersTab.tsx index e41d571..93afeb4 100644 --- a/src/components/DraftOrdersTab.tsx +++ b/src/components/DraftOrdersTab.tsx @@ -7,6 +7,7 @@ import { Table, TableBody, TableCell, + TableHead, TableHeader, TableRow, } from "@bleu/ui"; @@ -25,7 +26,7 @@ export function DraftOrdersTab() { const [selectedIds, setSelectedIds] = useState([]); const selectedOrders = draftOrders.filter((order) => - selectedIds.includes(order.id), + selectedIds.includes(order.id) ); return ( @@ -38,13 +39,15 @@ export function DraftOrdersTab() {
- - Select - - Order - Trigger price - Limit price - Current price + + + Select + + Order + Trigger price + Limit price + Current price + {draftOrders.length ? ( @@ -59,7 +62,7 @@ export function DraftOrdersTab() { return; } setSelectedIds( - selectedIds.filter((id) => id !== order.id), + selectedIds.filter((id) => id !== order.id) ); }} /> @@ -120,7 +123,7 @@ export function DraftOrderRow({ const { useTokenPairPrice } = useTokens(); const { data: marketPrice } = useTokenPairPrice( order.tokenSell, - order.tokenBuy, + order.tokenBuy ); return ( diff --git a/src/components/HistoryOrdersTab.tsx b/src/components/HistoryOrdersTab.tsx index 9736729..b15fcfe 100644 --- a/src/components/HistoryOrdersTab.tsx +++ b/src/components/HistoryOrdersTab.tsx @@ -8,6 +8,7 @@ import { Table, TableBody, TableCell, + TableHead, TableHeader, TableRow, } from "@bleu/ui"; @@ -27,14 +28,16 @@ export function HistoryOrdersTab() { return (
- Created - Order - Trigger price - Filled - Status - - Details - + + Created + Order + Trigger price + Filled + Status + + Details + + {historyOrders.length ? ( @@ -76,18 +79,18 @@ export function HistoryOrderRow({ order }: { order: StopLossOrderType }) { const amountSell = Number( formatUnits( order.stopLossData?.tokenAmountIn, - order.stopLossData.tokenIn.decimals, - ), + order.stopLossData.tokenIn.decimals + ) ); const amountBuy = Number( formatUnits( order.stopLossData?.tokenAmountOut, - order.stopLossData.tokenOut.decimals, - ), + order.stopLossData.tokenOut.decimals + ) ); const orderDateTime = epochToDate( - Number(order.blockTimestamp), + Number(order.blockTimestamp) ).toLocaleString(); return ( diff --git a/src/components/OpenOrdersTab.tsx b/src/components/OpenOrdersTab.tsx index f5f7310..6079d9f 100644 --- a/src/components/OpenOrdersTab.tsx +++ b/src/components/OpenOrdersTab.tsx @@ -8,6 +8,7 @@ import { Table, TableBody, TableCell, + TableHead, TableHeader, TableRow, } from "@bleu/ui"; @@ -52,18 +53,20 @@ export function OpenOrdersTab() {
- - Select - - Created - Order - Trigger price - Current market price - Filled - Status - - Details - {" "} + + + Select + + Created + Order + Trigger price + Current market price + Filled + Status + + Details + {" "} + {openOrders.length ? ( @@ -129,7 +132,7 @@ export function OpenOrderRow({ const { data: marketPrice } = useTokenPairPrice( order.stopLossData?.tokenIn as IToken, - order.stopLossData?.tokenOut as IToken, + order.stopLossData?.tokenOut as IToken ); const priceUnity = @@ -142,18 +145,18 @@ export function OpenOrderRow({ const amountSell = Number( formatUnits( order.stopLossData?.tokenAmountIn, - order.stopLossData.tokenIn.decimals, - ), + order.stopLossData.tokenIn.decimals + ) ); const amountBuy = Number( formatUnits( order.stopLossData?.tokenAmountOut, - order.stopLossData.tokenOut.decimals, - ), + order.stopLossData.tokenOut.decimals + ) ); const orderDateTime = epochToDate( - Number(order.blockTimestamp), + Number(order.blockTimestamp) ).toLocaleString(); return ( diff --git a/src/components/RootLayout.tsx b/src/components/RootLayout.tsx index 957847e..306ca61 100644 --- a/src/components/RootLayout.tsx +++ b/src/components/RootLayout.tsx @@ -1,3 +1,4 @@ +"use client"; import { Toaster } from "@bleu/ui"; import SafeProvider from "@safe-global/safe-apps-react-sdk"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; diff --git a/src/contexts/tokensContext.tsx b/src/contexts/tokensContext.tsx index cb36913..a7b96fb 100644 --- a/src/contexts/tokensContext.tsx +++ b/src/contexts/tokensContext.tsx @@ -27,7 +27,7 @@ interface ITokensContext { useTokenPrice: (token: IToken) => { data?: number; error: any }; useTokenPairPrice: ( tokenSell: IToken, - tokenBuy: IToken, + tokenBuy: IToken ) => { data?: number; // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -36,12 +36,12 @@ interface ITokensContext { getOrFetchTokenPrice: (token?: IToken) => Promise; getTokenPairPrice: ( tokenSell?: IToken, - tokenBuy?: IToken, + tokenBuy?: IToken ) => Promise; } export const TokensContext = React.createContext( - {} as ITokensContext, + {} as ITokensContext ); function fetchFromLocalStorage(key: string): T | null { @@ -74,7 +74,7 @@ export const TokensContextProvider = ({ function getTokenList() { return [ ...(cowTokenList.filter( - (token) => token.chainId === chainId, + (token) => token.chainId === chainId ) as IToken[]), ...importedTokenList, ]; @@ -128,7 +128,7 @@ export const TokensContextProvider = ({ () => getTokenPairPrice(tokenSell, tokenBuy), { refreshInterval: TOKEN_PRICE_CACHE_DURATION, - }, + } ); }; @@ -140,7 +140,7 @@ export const TokensContextProvider = ({ setImportedTokenList(newImportedTokenList); localStorage.setItem( "importedTokens", - JSON.stringify(newImportedTokenList), + JSON.stringify(newImportedTokenList) ); } @@ -148,7 +148,7 @@ export const TokensContextProvider = ({ const importedTokens = fetchFromLocalStorage("importedTokens"); setImportedTokenList( - importedTokens?.filter((token) => token.chainId === chainId) || [], + importedTokens?.filter((token) => token.chainId === chainId) || [] ); }, [chainId]);