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

feat(bridge-ui-v2): navigation support to swap-ui from bridge-ui #15922

Merged
merged 5 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/bridge-ui-v2/.env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Default explorer as fallback for the sidebar
export PUBLIC_DEFAULT_EXPLORER=https://

# Use the network swap Url
export PUBLIC_DEFAULT_SWAP_URL=https://

# Use the bridge guide Urls
export PUBLIC_GUIDE_URL=https://

Expand Down
10 changes: 9 additions & 1 deletion packages/bridge-ui-v2/src/components/Icon/Icon.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
| 'approve-light'
| 'approve-dark'
| 'welcome-icon'
| 'settings';
| 'settings'
| 'swap';
</script>

<script lang="ts">
Expand Down Expand Up @@ -494,5 +495,12 @@
fill-rule="evenodd"
clip-rule="evenodd"
fill="none" />
{:else if type === 'swap'}
<path
d="M8.75 1.410156 L8.75 18.75 C7.371094 18.75 6.25 17.628906 6.25 16.25 L6.25 8.125 L2.945312 8.125 C2.550781 8.125 2.351562 7.648438 2.632812 7.367188 L8.636719 1.363281 C8.679688 1.320312 8.75 1.351562 8.75 1.410156 Z M17.367188 12.632812 L11.367188 18.632812 C11.324219 18.675781 11.25 18.644531 11.25 18.582031 L11.25 1.25 C12.628906 1.25 13.75 2.371094 13.75 3.75 L13.75 11.875 L17.054688 11.875 C17.449219 11.875 17.648438 12.351562 17.367188 12.632812 Z M17.367188 12.632812"
class={fillClass}
fill-rule="evenodd"
clip-rule="evenodd"
fill="none" />
{/if}
</svg>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import { LinkButton } from '$components/LinkButton';
import { LogoWithText } from '$components/Logo';
import { ThemeButton } from '$components/ThemeButton';
import { PUBLIC_DEFAULT_EXPLORER, PUBLIC_GUIDE_URL } from '$env/static/public';
import { PUBLIC_DEFAULT_EXPLORER, PUBLIC_DEFAULT_SWAP_URL, PUBLIC_GUIDE_URL } from '$env/static/public';
import { connectedSourceChain } from '$stores/network';

let drawerToggleElem: HTMLInputElement;
Expand Down Expand Up @@ -97,6 +97,12 @@
</LinkButton>
</li>
<li class="border-t border-t-divider-border pt-2">
<LinkButton href={PUBLIC_DEFAULT_SWAP_URL} external>
<Icon type="swap" />
<span>{$t('nav.swap')}</span>
</LinkButton>
</li>
<li>
<LinkButton
href={$connectedSourceChain
? chainConfig[$connectedSourceChain.id].urls.explorer
Expand Down
3 changes: 2 additions & 1 deletion packages/bridge-ui-v2/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,8 @@
"nft": "NFT",
"theme": "Theme",
"token": "Token",
"transactions": "Transactions"
"transactions": "Transactions",
"swap": "Swap"
},
"paused_modal": {
"description": "The bridge is currently not available. Follow our official communcation channels for more information. ",
Expand Down
Loading