Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
dantaik committed Jul 4, 2024
2 parents c70d6dd + 9d18504 commit 548d811
Show file tree
Hide file tree
Showing 70 changed files with 666 additions and 1,073 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"packages/branding": "0.4.0",
"packages/bridge-ui": "2.11.0",
"packages/docs-site": "1.11.2",
"packages/docs-site": "1.11.3",
"packages/eventindexer": "0.13.0",
"packages/fork-diff": "0.6.0",
"packages/guardian-prover-health-check": "0.1.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { onMount } from 'svelte';
import { importDone, processingFeeMethod, recipientAddress } from '$components/Bridge/state';
import { destOwnerAddress, importDone, processingFeeMethod, recipientAddress } from '$components/Bridge/state';
import { ChainSelector, ChainSelectorType } from '$components/ChainSelectors';
import { ProcessingFeeMethod } from '$libs/fee';
Expand All @@ -14,6 +14,7 @@
const reset = () => {
$recipientAddress = null;
$destOwnerAddress = null;
$processingFeeMethod = ProcessingFeeMethod.RECOMMENDED;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import { debounce } from '$libs/util/debounce';
import { getLogger } from '$libs/util/logger';
import { truncateDecimal } from '$libs/util/truncateDecimal';
import { uid } from '$libs/util/uid';
import { account } from '$stores/account';
import { ethBalance } from '$stores/balance';
import { connectedSourceChain } from '$stores/network';
Expand All @@ -46,7 +45,7 @@
export let hasEnoughEth: boolean = false;
export let exceedsQuota: boolean = false;
let inputId = `input-${uid()}`;
let inputId = `input-${crypto.randomUUID()}`;
let inputBox: InputBox;
let value = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,19 @@
import { chainConfig } from '$chainConfig';
import { Alert } from '$components/Alert';
import { ProcessingFee, Recipient } from '$components/Bridge/SharedBridgeComponents';
import { destNetwork as destChain, enteredAmount, processingFee, selectedToken } from '$components/Bridge/state';
import DestOwner from '$components/Bridge/SharedBridgeComponents/RecipientStep/DestOwner.svelte';
import {
destNetwork as destChain,
destOwnerAddress,
enteredAmount,
processingFee,
selectedToken,
} from '$components/Bridge/state';
import { PUBLIC_SLOW_L1_BRIDGING_WARNING } from '$env/static/public';
import { LayerType } from '$libs/chain';
import { isStablecoin, isSupported, isWrapped, type Token, TokenType } from '$libs/token';
import { isWrapped, type Token, TokenType } from '$libs/token';
import { isToken } from '$libs/token/isToken';
import { account } from '$stores/account';
import { ethBalance } from '$stores/balance';
import { connectedSourceChain } from '$stores/network';
Expand All @@ -19,6 +27,7 @@
export let hasEnoughFundsToContinue: boolean = true;
let recipientComponent: Recipient;
let destOwnerComponent: DestOwner;
let processingFeeComponent: ProcessingFee;
let slowL1Warning = PUBLIC_SLOW_L1_BRIDGING_WARNING || false;
Expand All @@ -27,14 +36,12 @@
$: wrapped = $selectedToken !== null && isWrapped($selectedToken as Token);
$: unsupportedStableCoin =
$selectedToken !== null && !isSupported($selectedToken as Token) && isStablecoin($selectedToken as Token);
// $: unsupportedStableCoin =
// $selectedToken !== null && !isSupported($selectedToken as Token) && isStablecoin($selectedToken as Token);
$: wrappedAssetWarning = $t('bridge.alerts.wrapped_eth');
$: stableCoinWarning = $t('bridge.alerts.stable_coin');
$: if (wrapped || unsupportedStableCoin) {
$: if (wrapped) {
needsManualReviewConfirmation = true;
} else {
needsManualReviewConfirmation = false;
Expand Down Expand Up @@ -106,6 +113,9 @@ Recipient & Processing Fee
<button class="flex justify-start link" on:click={editTransactionDetails}> {$t('common.edit')} </button>
</div>
<Recipient bind:this={recipientComponent} small />
{#if $destOwnerAddress !== $account?.address && $destOwnerAddress}
<DestOwner bind:this={destOwnerComponent} small />
{/if}
<ProcessingFee bind:this={processingFeeComponent} small bind:hasEnoughEth />
</div>

Expand All @@ -117,8 +127,3 @@ Recipient & Processing Fee
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
<Alert type="warning">{@html wrappedAssetWarning}</Alert>
{/if}

{#if unsupportedStableCoin}
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
<Alert type="warning">{@html stableCoinWarning}</Alert>
{/if}
2 changes: 2 additions & 0 deletions packages/bridge-ui/src/components/Bridge/NFTBridge.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import {
activeBridge,
destNetwork as destinationChain,
destOwnerAddress,
importDone,
recipientAddress,
selectedNFTs,
Expand Down Expand Up @@ -101,6 +102,7 @@
if (nftIdInputComponent) nftIdInputComponent.clearIds();
$recipientAddress = $account?.address || null;
$destOwnerAddress = $account?.address || null;
bridgingStatus = BridgingStatus.PENDING;
$selectedToken = ETHToken;
importMethod === null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import { Icon } from '$components/Icon';
import InputBox from '$components/InputBox/InputBox.svelte';
import { uid } from '$libs/util/uid';
import { IDInputState as State } from './state';
Expand All @@ -24,7 +23,7 @@
const dispatch = createEventDispatcher();
let inputId = `input-${uid()}`;
let inputId = `input-${crypto.randomUUID()}`;
function validateInput(idInput: EventTarget | number[] | null = null) {
state = State.VALIDATING;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import { ETHToken, fetchBalance, fetchBalance as getTokenBalance, TokenType } from '$libs/token';
import { debounce } from '$libs/util/debounce';
import { getLogger } from '$libs/util/logger';
import { uid } from '$libs/util/uid';
import { account } from '$stores/account';
import { ethBalance } from '$stores/balance';
import { connectedSourceChain } from '$stores/network';
Expand All @@ -30,7 +29,7 @@
const log = getLogger('component:Amount');
let inputId = `input-${uid()}`;
let inputId = `input-${crypto.randomUUID()}`;
let inputBox: InputBox;
let computingMaxAmount = false;
let invalidInput = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
import { Icon } from '$components/Icon';
import { withHoverAndFocusListener } from '$libs/customActions';
import { classNames } from '$libs/util/classNames';
import { uid } from '$libs/util/uid';
import { account } from '$stores/account';
import { AddressInputState as State } from './state';
let inputElement: HTMLInputElement;
let inputId = `input-${uid()}`;
let inputId = `input-${crypto.randomUUID()}`;
let isElementFocused = false;
let isElementHovered = false;
Expand All @@ -26,6 +26,7 @@
export let isDisabled = false;
export let quiet = false;
export let state: State = State.DEFAULT;
export let resettable = false;
export let onDialog = false;
Expand Down Expand Up @@ -54,6 +55,12 @@
state = State.DEFAULT;
};
const setToCurrentAddress = (): void => {
clearAddress();
ethereumAddress = $account?.address || '';
validateAddress();
};
export const focus = (): void => inputElement.focus();
$: defaultBorder = (() => {
Expand All @@ -78,6 +85,9 @@
<!-- Input field and label -->
<div class="f-between-center text-secondary-content">
<label class="body-regular" for={inputId}>{labelText}</label>
{#if resettable}
<button class="link" on:click={setToCurrentAddress}>{$t('common.reset_to_wallet')}</button>
{/if}
</div>
<div class="relative f-items-center">
<input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import { closeOnEscapeOrOutsideClick } from '$libs/customActions';
import { ProcessingFeeMethod } from '$libs/fee';
import { parseToWei } from '$libs/util/parseToWei';
import { uid } from '$libs/util/uid';
import NoneOption from './NoneOption.svelte';
import RecommendedFee from './RecommendedFee.svelte';
Expand All @@ -23,7 +22,7 @@
export let hasEnoughEth: boolean = false;
export let disabled = false;
let dialogId = `dialog-${uid()}`;
let dialogId = `dialog-${crypto.randomUUID()}`;
let recommendedAmount = BigInt(0);
let errorCalculatingRecommendedAmount = false;
Expand Down
Loading

0 comments on commit 548d811

Please sign in to comment.