Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bridge-ui): inform connect when adding erc20 #13900

Merged
merged 13 commits into from
Jun 6, 2023
17 changes: 15 additions & 2 deletions packages/bridge-ui/src/components/BridgeForm/SelectToken.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
import { tokens } from '../../token/tokens';
import { selectTokenAndBridgeType } from '../../utils/selectTokenAndBridgeType';
import Erc20 from '../icons/ERC20.svelte';
import { errorToast, successToast } from '../NotificationToast.svelte';
import {
errorToast,
successToast,
warningToast,
} from '../NotificationToast.svelte';
import AddCustomErc20 from './AddCustomERC20.svelte';

let dropdownElement: HTMLDivElement;
Expand All @@ -33,6 +37,15 @@
closeDropdown();
}

function showAddERC20() {
if (!$signer) {
warningToast('Please, connect your wallet.');
jscriptcoder marked this conversation as resolved.
Show resolved Hide resolved
return;
}

showAddressField = true;
}

async function addERC20(event: SubmitEvent) {
loading = true;

Expand Down Expand Up @@ -140,7 +153,7 @@

<li>
<button
on:click={() => (showAddressField = true)}
on:click={showAddERC20}
class="flex hover:bg-dark-5 justify-between items-center p-4 rounded-sm">
<PlusCircle size="25" />
<span
Expand Down
Loading