Skip to content

Commit

Permalink
chore: slippage → max slippage
Browse files Browse the repository at this point in the history
  • Loading branch information
grikomsn committed Nov 3, 2023
1 parent abfe959 commit 89ee3d0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/components/AssetInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { getFee, useBalancesByChain } from "@/utils/utils";

import AssetSelect from "./AssetSelect";
import ChainSelect from "./ChainSelect";
import { useSettingsStore } from "@/context/settings";
import { disclosure } from "@/context/disclosures";

interface Props {
amount: string;
Expand Down Expand Up @@ -77,6 +79,8 @@ const AssetInput: FC<Props> = ({
return selectedAssetBalance === "0.0";
}, [selectedAssetBalance]);

const { slippage } = useSettingsStore();

return (
<Fragment>
<div className="space-y-4 border border-neutral-200 p-4 rounded-lg">
Expand Down Expand Up @@ -109,6 +113,14 @@ const AssetInput: FC<Props> = ({
{amount}
</p>
)}
{!onAmountChange && amount !== "0.0" && (
<button
className="text-neutral-400 text-sm hover:underline"
onClick={() => disclosure.open("settingsDialog")}
>
Max Slippage: {slippage}%
</button>
)}
{onAmountChange && (
<input
className="w-full text-3xl font-medium focus:outline-none placeholder:text-neutral-300"
Expand Down

0 comments on commit 89ee3d0

Please sign in to comment.