Skip to content

Commit 3563a94

Browse files
committed
chore: cleanup
1 parent bb7cd95 commit 3563a94

File tree

1 file changed

+44
-21
lines changed

1 file changed

+44
-21
lines changed

apps/namadillo/src/App/Swap/SwapReview.tsx

Lines changed: 44 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ActionButton, Stack, Text } from "@namada/components";
22
import { ConnectProviderButton } from "App/Common/ConnectProviderButton";
33
import { CurrentStatus } from "App/Common/CurrentStatus";
4+
import { IconTooltip } from "App/Common/IconTooltip";
45
import { InlineError } from "App/Common/InlineError";
56
import { LedgerDeviceTooltip } from "App/Common/LedgerDeviceTooltip";
67
import { SelectWalletModal } from "App/Common/SelectWalletModal";
@@ -17,6 +18,7 @@ import { getAssetImageUrl } from "integrations/utils";
1718
import invariant from "invariant";
1819
import { useAtom, useAtomValue } from "jotai";
1920
import { useCallback, useEffect, useState } from "react";
21+
import { BsQuestionCircleFill } from "react-icons/bs";
2022
import { toDisplayAmount } from "utils";
2123
import { usePerformOsmosisSwapTx } from "./hooks/usePerformOsmosisSwapTx";
2224
import { useSwapReviewValidation } from "./hooks/useSwapReviewValidation";
@@ -171,39 +173,45 @@ export const SwapReview = (): JSX.Element => {
171173
</Stack>
172174
<hr className="my-5 mx-2 border-white opacity-[5%]" />
173175
<Stack gap={3}>
174-
<Stack
175-
direction="horizontal"
176-
className="justify-between text-neutral-300 text-sm"
177-
>
176+
<ReviewRow>
178177
<div>Swap Fee</div>
179178
<p>
180179
{fiatFeeDisplay} ({swapFee.toString()}%)
181180
</p>
182-
</Stack>
183-
<Stack
184-
direction="horizontal"
185-
className="justify-between text-neutral-300 text-sm"
186-
>
181+
</ReviewRow>
182+
<ReviewRow>
187183
<div>Slippage tolerance</div>
188184
<div>{SLIPPAGE * 100}%</div>
189-
</Stack>
190-
<Stack
191-
direction="horizontal"
192-
className="justify-between text-neutral-300 text-sm"
193-
>
185+
</ReviewRow>
186+
<ReviewRow>
194187
<div>Receive at least</div>
195188
<div>
196189
{receiveAtLeastDenominated.toString()} {buyAsset.symbol}
197190
</div>
198-
</Stack>
191+
</ReviewRow>
199192
{walletAddress && (
200-
<Stack
201-
direction="horizontal"
202-
className="justify-between text-neutral-300 text-sm"
203-
>
204-
<div>Local recovery address</div>
193+
<ReviewRow>
194+
<Stack
195+
direction="horizontal"
196+
className="relative items-center"
197+
gap={2}
198+
>
199+
Local recovery address
200+
<IconTooltip
201+
className=""
202+
icon={
203+
<BsQuestionCircleFill className="w-4 h-4 text-yellow" />
204+
}
205+
text={
206+
<span>
207+
This is the address where your assets will land in case
208+
something goes wrong on the destination chain.
209+
</span>
210+
}
211+
/>
212+
</Stack>
205213
<WalletAddress address={walletAddress} displayTooltip={true} />
206-
</Stack>
214+
</ReviewRow>
207215
)}
208216
</Stack>
209217
</div>
@@ -263,6 +271,21 @@ export const SwapReview = (): JSX.Element => {
263271
);
264272
};
265273

274+
const ReviewRow = ({
275+
children,
276+
}: {
277+
children: React.ReactNode;
278+
}): JSX.Element => {
279+
return (
280+
<Stack
281+
direction="horizontal"
282+
className="justify-between text-neutral-300 text-sm"
283+
>
284+
{children}
285+
</Stack>
286+
);
287+
};
288+
266289
const ValidationMessages: Record<string, string> = {
267290
NoWalletConnected: "Connect Keplr Wallet",
268291
LedgerDeviceNotConnected: "Connect your ledger and open the Namada App",

0 commit comments

Comments
 (0)