-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ee6ecd
commit b9281d7
Showing
4 changed files
with
101 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 20 additions & 8 deletions
28
packages/bridge-ui-v2/src/components/Bridge/BridgeTabs.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,37 @@ | ||
<script lang="ts"> | ||
import { t } from 'svelte-i18n'; | ||
import { page } from '$app/stores'; | ||
import { LinkButton } from '$components/LinkButton'; | ||
import { Button } from '$components/Button'; | ||
import { PUBLIC_NFT_BRIDGE_ENABLED } from '$env/static/public'; | ||
import { classNames } from '$libs/util/classNames'; | ||
import { activeBridge } from './state'; | ||
import { BridgeTypes } from './types'; | ||
let classes = classNames('space-x-2', $$props.class); | ||
$: isERC20Bridge = $page.route.id === '/'; | ||
$: isNFTBridge = $page.route.id === '/nft'; | ||
$: isERC20Bridge = $activeBridge === BridgeTypes.FUNGIBLE; | ||
$: isNFTBridge = $activeBridge === BridgeTypes.NFT; | ||
const onBridgeClick = (type: BridgeTypes) => { | ||
activeBridge.set(type); | ||
}; | ||
</script> | ||
|
||
{#if PUBLIC_NFT_BRIDGE_ENABLED === 'true'} | ||
<div class={classes}> | ||
<LinkButton class="py-2 px-[20px]" href="/" active={isERC20Bridge}> | ||
<Button | ||
type={isERC20Bridge ? 'primary' : 'neutral'} | ||
class="px-[28px] py-[14px] rounded-full flex-1 text-white" | ||
on:click={() => onBridgeClick(BridgeTypes.FUNGIBLE)}> | ||
<span> {$t('nav.token')}</span> | ||
</LinkButton> | ||
</Button> | ||
|
||
<LinkButton class="py-2 px-[20px]" href="/nft" active={isNFTBridge}> | ||
<Button | ||
type={isNFTBridge ? 'primary' : 'neutral'} | ||
class="px-[28px] py-[14px] rounded-full flex-1 text-white" | ||
on:click={() => onBridgeClick(BridgeTypes.NFT)}> | ||
<span> {$t('nav.nft')}</span> | ||
</LinkButton> | ||
</Button> | ||
</div> | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export enum BridgeTypes { | ||
FUNGIBLE = 'FUNGIBLE', | ||
NFT = 'NFT', | ||
} | ||
|
||
export enum NFTSteps { | ||
IMPORT, | ||
REVIEW, | ||
CONFIRM, | ||
} | ||
|
||
export type BridgeType = BridgeTypes; |