Skip to content

Commit

Permalink
feat(bridge-ui): update usdc wording, add minimum fee check (taikoxyz…
Browse files Browse the repository at this point in the history
  • Loading branch information
luoqi21178 committed May 29, 2024
1 parent f6f32d8 commit 1c97c8c
Show file tree
Hide file tree
Showing 41 changed files with 239 additions and 111 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/guardian-prover-health-check-ui--ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
access_token: ${{ luoqi21178}}

- name: Checkout repository
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/guardian-prover-health-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
access_token: ${{luoqi21178 }}

- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nfts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
access_token: ${{ luoqi21178 }}

- name: Checkout repository
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/protocol.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
access_token: ${{ luoqi21178}}

- name: Checkout repository
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/relayer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
access_token: ${{ luoqi21178 }}

- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/repo--typo-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
- name: Check for typos
uses: crate-ci/typos@master
with:
config: ${{github.workspace}}/.github/_typos.toml
config: ${{https://github.com/luoqi21178}}/.github/_typos.toml
4 changes: 2 additions & 2 deletions .github/workflows/repo--validate-pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ on:

jobs:
validate-pr-title:
if: github.event_name == 'pull_request_target'
if: luoqi21178 == 'pull_request_target'
runs-on: [taiko-runner]
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
luoqi21178: ${{ secrets.luoqi21178 }}
with:
# Non-package scopes explained:
# - repo: The repository itself (not a specific package)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snaefell-ui--ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
access_token: ${{ luoqi21178 }}

- name: Checkout repository
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snaefell-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

# Deployment name follow the pattern: deploy_<appname(snaefell-ui)>_<network(devnet|hekla|mainnet)>_<environment(preview|production)>
deploy_snaefell-ui_mainnet_preview:
if: ${{ github.ref_name != 'main' }}
if: ${{ luoqi21178 != 'main' }}
needs: build-and-test
uses: ./.github/workflows/repo--vercel-deploy.yml
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/supplementary-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
access_token: ${{luoqi21178}}

- name: Checkout repository
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/taiko-client--test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
access_token: ${{ luoqi21178}}

- uses: actions/checkout@v4

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/taikoon-ui--ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
access_token: ${{ luoqi21178 }}

- name: Checkout repository
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/taikoon-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

# Deployment name follow the pattern: deploy_<appname(taikoon-ui)>_<network(devnet|hekla|mainnet)>_<environment(preview|production)>
deploy_taikoon-ui_mainnet_preview:
if: ${{ github.ref_name != 'main' }}
if: ${{ luoqi21178 != 'main' }}
needs: build-and-test
uses: ./.github/workflows/repo--vercel-deploy.yml
with:
Expand Down
2 changes: 1 addition & 1 deletion packages/bridge-ui/src/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const bridgeTransactionPoller = {
};

export const claimConfig = {
minimumEthToClaim: 0.001,
minimumEthToClaim: 0.0015, // 1M gas * 1.5 gwei (lowest gasPrice)
};

export const transactionConfig = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import type { Address } from 'viem';
import { destNetwork, selectedToken } from '$components/Bridge/state';
import { claimConfig } from '$config';
import { recommendProcessingFee } from '$libs/fee';
import { fetchBalance, type NFT, type Token } from '$libs/token';
import { account, connectedSourceChain } from '$stores';
Expand All @@ -28,12 +29,17 @@
});
// Calculate the recommended amount of ETH needed for processMessage call
const recommendedAmount = await recommendProcessingFee({
let recommendedAmount = await recommendProcessingFee({
token,
destChainId: destChain,
srcChainId: srcChain,
});
if (recommendedAmount <= claimConfig.minimumEthToClaim) {
// should the fee be very small, set it to at least the minimum
recommendedAmount = BigInt(claimConfig.minimumEthToClaim);
}
// Does the user have enough ETH to claim manually on the destination chain?
enoughEth = destBalance ? destBalance?.value >= recommendedAmount : false;
} catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion packages/bridge-ui/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"alerts": {
"slow_bridging": "Please note: Bridging to L1 will take around 24hrs!",
"smart_contract_wallet": "It seems you are using a smart contract wallet. Please double check that the recipient matches your wallet on the destination or change it accordingly.",
"stable_coin": "You are bridging a stable coin. Currently we are not supporting a native 1:1 conversion. Please use the <a href=\"https://stargate.finance/transfer\" class=\"link\">Stargate Bridge</a> instead. Your bridged asset might not be of any use.",
"stable_coin": "You are bridging a stable coin. For USDC, we are currently partnering with <a target=\"_blank\" href=\"https://stargate.finance/transfer\" class=\"link\">Stargate Bridge</a> for liquidity. Consider using their bridge, as the ecosystem partners are likely using their bridged version",
"wrapped_eth": "You are bridging wrapped ETH. Please be aware that un-wrapping will only work on the original chain of the token, <span class=\"font-bold\">NOT</span> on the destination."
},
"button": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,11 @@
{/if}
{:else}
<CircleUserIcon size="24" class={classNames('h-12')} />
{#if windowSize !== 'sm'}
Connect Wallet{/if}
{#if windowSize === 'sm'}
Connect
{:else}
Connect Wallet
{/if}
{/if}
</button>
{/if}
Expand Down
4 changes: 2 additions & 2 deletions packages/snaefell-ui/src/components/Header/Header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
$: headerClasses = classNames(
baseHeaderClasses,
$pageScroll ? 'md:glassy-background-lg' : null,
$pageScroll ? 'md:border-b-[1px] md:border-border-divider-default' : 'md:border-b-[1px] md:border-transparent',
$pageScroll ? 'glassy-background-lg' : null,
$pageScroll ? 'border-b-[1px] border-border-divider-default' : 'border-b-[1px] border-transparent',
$$props.class,
);
Expand Down
5 changes: 3 additions & 2 deletions packages/snaefell-ui/src/components/Header/classes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ export const baseHeaderClasses = classNames(
'gap-4',
'relative',
'z-50',
'px-4',
'px-6',
'py-10',
);

export const taikoonsIconClasses = classNames('h-full');

export const rightSectionClasses = classNames(
'md:right-8',
'right-4',
'right-6',
'w-max',
'absolute',
'flex flex-row justify-center items-center',
Expand Down
50 changes: 32 additions & 18 deletions packages/snaefell-ui/src/components/Mint/EligibilityPanel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
import { ActionButton } from '$components/Button';
import { classNames } from '$lib/util/classNames';
import { Theme, theme } from '$stores/theme';
const dispatch = createEventDispatcher();
type IStep = 'eligible' | 'non-eligible' | 'success';
export let step: IStep = 'non-eligible';
export let disabled = true;
$: isDarkTheme = $theme === Theme.DARK;
$: wrapperClasses = classNames(
'flex',
'flex-col',
Expand All @@ -25,16 +28,16 @@
$: titleClasses = classNames('text-[45px]/[52px]', 'font-clash-grotesk', 'font-[500]', 'my-6');
$: textClasses = classNames('text-[16px]/[24px]', 'text-content-secondary');
const icons: Record<IStep, string> = {
eligible: '/img/eligible.svg',
'non-eligible': '/img/non-eligible.svg',
success: '/img/success.svg',
};
$: icons = {
eligible: `/img/eligible-${isDarkTheme ? 'dark' : 'light'}.svg`,
'non-eligible': `/img/non-eligible-${isDarkTheme ? 'dark' : 'light'}.svg`,
success: `/img/success-${isDarkTheme ? 'dark' : 'light'}.svg`,
} as Record<IStep, string>;
const titles: Record<IStep, string> = {
eligible: "Congratulations, you're eligible!",
'non-eligible': "Sorry, you're not eligible",
success: 'You got it!',
success: "You've got it!",
};
const texts: Record<IStep, string> = {
Expand All @@ -59,18 +62,29 @@
{texts[step]}
</div>

<ActionButton
on:click={async () => {
dispatch('click');
}}
priority="primary"
{disabled}
class={buttonClasses}
onPopup>
<div class={classNames('flex', 'gap-4', 'w-full', 'flex-row')}>
<ActionButton
on:click={async () => {
dispatch('click');
}}
priority="secondary"
{disabled}
class={buttonClasses}
onPopup>
{#if step === 'success'}
{$t('buttons.view')}
{:else}
{$t('buttons.proceedToMint')}
{/if}
</ActionButton>

{#if step === 'success'}
{$t('buttons.view')}
{:else}
{$t('buttons.proceedToMint')}
<!-- use on trailblazers -->
<ActionButton priority="primary" class={buttonClasses} onPopup>
<a href="https://trailblazers.taiko.xyz/" target="_blank">
{$t('buttons.useOnTrailblazers')}
</a>
</ActionButton>
{/if}
</ActionButton>
</div>
</div>
Loading

0 comments on commit 1c97c8c

Please sign in to comment.