Skip to content

Commit

Permalink
fix: made all swap hooks text files
Browse files Browse the repository at this point in the history
  • Loading branch information
philix27 committed Oct 12, 2024
1 parent e285363 commit 6e30d09
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 74 deletions.
2 changes: 1 addition & 1 deletion client/app/(others)/dash-swap/Currencies.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use client';
import { ChainId, Token, TokenAddresses, TokenList, use3Wagmi } from '@/lib';
import { ChainId, Token, TokenAddresses, TokenList } from '@/lib';
import { TokenIcon } from '@/public/tokens/TokenIcon';
import { BottomSheet, Row, TextP } from '@/comps';
import { useSwap } from './useSwap';
Expand Down
16 changes: 8 additions & 8 deletions client/app/(others)/dash-swap/Swap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { IoSwapVertical } from 'react-icons/io5';
import { ChangeSection } from './ValueSection';
import { useAccount } from 'wagmi';
import { useSwap } from './useSwap';
import { useSwapQuote } from './swap/useSwapQuote';
// import { useSwapQuote } from './swap/useSwapQuote';
import { toast } from 'sonner';

export default function Swap() {
Expand All @@ -21,12 +21,12 @@ export default function Swap() {
return TokenFn.getSwappableTokenOptions(selectedToken.fromTokens.id, chainId ? chainId : Celo.chainId);
}, [chainId, exchangeValue]);

const { isLoading, quote, rate } = useSwapQuote(
exchangeValue.fromToken,
store.direction,
selectedToken.fromTokens.id,
selectedToken.toTokens.id
);
// const { isLoading, quote, rate } = useSwapQuote(
// exchangeValue.fromToken,
// store.direction,
// selectedToken.fromTokens.id,
// selectedToken.toTokens.id
// );
// useEffect(() => {
// if (store.address === null || store.chainId === null) {
// if (address && chainId) {
Expand Down Expand Up @@ -142,7 +142,7 @@ export default function Swap() {
/>
</div>
<div className="flex flex-col items-center justify-center w-full">
{!isLoading && rate ? `${rate} ${selectedToken.fromTokens.id} ~ 1 ${selectedToken.toTokens.id}` : '...'}
{/* {!isLoading && rate ? `${rate} ${selectedToken.fromTokens.id} ~ 1 ${selectedToken.toTokens.id}` : '...'} */}
<AppButton className="w-[75%]" onClick={onSubmit}>
Continue
</AppButton>
Expand Down
2 changes: 1 addition & 1 deletion client/app/(others)/dash-swap/SwapConfirm.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use client';
import React, { useEffect, useState } from 'react';
import React, { useState } from 'react';
// import { useApproveTransaction } from './swap/useApproveTransaction';
// import { useSwapTransaction } from './swap/useSwapTransaction';
// import { logger } from '@/utils';
Expand Down
2 changes: 1 addition & 1 deletion client/app/(others)/dash-swap/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { BottomCurrencies } from './Currencies';
import { MdClose } from 'react-icons/md';
import dynamic from 'next/dynamic';

const SwapConfirm = dynamic(() => import('./SwapConfirm').then((module) => module.default), {
const SwapConfirm = dynamic(() => import('./SwapConfirm'), {
loading: () => <Spinner />,
});
const Swap = dynamic(() => import('./Swap'), { loading: () => <Spinner /> });
Expand Down
File renamed without changes.
60 changes: 0 additions & 60 deletions client/app/(others)/dash-swap/useAcctBalance.ts

This file was deleted.

4 changes: 1 addition & 3 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"@radix-ui/react-slot": "^1.0.2",
"@rainbow-me/rainbowkit": "^2.1.3",
"@sentry/nextjs": "^8",
"@shopify/react-web-worker": "^5.1.5",
"@tanstack/react-query": "^4.35.3",
"@trpc/client": "^10.44.1",
"@trpc/next": "^10.44.1",
Expand Down Expand Up @@ -67,10 +66,9 @@
"date-fns": "^4.1.0",
"decimal.js-light": "^2.5.1",
"ethers": "^6.13.2",
"framer-motion": "^10.17.9",
"framer-motion": "^11.11.8",
"frappe-charts": "^1.6.2",
"jsbi": "^4.3.0",
"lottie-react": "^2.4.0",
"net": "^1.0.2",
"next": "14.2.10",
"next-themes": "^0.2.1",
Expand Down

0 comments on commit 6e30d09

Please sign in to comment.