Skip to content

Commit

Permalink
feat: updated UI
Browse files Browse the repository at this point in the history
  • Loading branch information
impelcrypto committed Nov 27, 2024
1 parent 6211477 commit 6111c9c
Show file tree
Hide file tree
Showing 17 changed files with 117 additions and 37 deletions.
17 changes: 17 additions & 0 deletions src/assets/img/chain/soneium-black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/assets/img/chain/soneium-color.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 32 additions & 3 deletions src/components/assets/transfer/Information.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<astar-icon-play size="24" />
</div>
</a>
<div id="faq" class="container--information">
<div v-if="transferType !== HistoryTxType.CCIP_BRIDGE" id="faq" class="container--information">
<div class="row--title">
<astar-icon-group size="20" />
<span>{{ $t('assets.transferPage.faq') }}</span>
Expand Down Expand Up @@ -53,6 +53,33 @@
</div>
</div>
</div>

<div
v-if="transferType === HistoryTxType.CCIP_BRIDGE && !isHistory"
id="history"
class="container--information"
>
<div class="box--contents">
<div class="row--title">
<astar-icon-history size="20" />
<span>{{ $t('assets.transferPage.recentHistory') }}</span>
</div>
<div>
<a
:href="`${ccipExplorerUrl}/address/${currentAccount}`"
target="_blank"
rel="noopener noreferrer"
class="container--hot-topics-contents"
>
<span class="text-topics-link"> Find your recent history on CCIP Explorer </span>
<div class="container--explorer-icon">
<astar-icon-external-link />
</div>
</a>
</div>
</div>
</div>

<div id="hot-topics" class="container--information">
<div class="row--title">
<astar-icon-group size="20" />
Expand Down Expand Up @@ -101,8 +128,8 @@ import { useStore } from 'src/store';
import { computed, defineComponent, PropType, ref, watchEffect, onUnmounted } from 'vue';
import { RecentLzHistory } from '../../../modules/information/index';
import { getLzTxHistories } from '../../../modules/information/recent-history/transfer/index';
import { LOCAL_STORAGE } from '../../../config/localStorage';
import { endpointKey, providerEndpoints } from '../../../config/chainEndpoints';
import { ccipExplorerUrl } from 'src/links';
export default defineComponent({
components: { TransactionHistory, LzHistory },
Expand All @@ -124,7 +151,6 @@ export default defineComponent({
const isLoadingTxHistories = ref<boolean>(true);
const { senderSs58Account, isMultisig, currentAccount } = useAccount();
const { currentNetworkName, isAstarZkEvm } = useNetworkInfo();
const isH160 = computed<boolean>(() => store.getters['general/isH160Formatted']);
const faqs = computed<Faq[]>(() => {
if (props.transferType === HistoryTxType.Transfer) {
Expand Down Expand Up @@ -199,6 +225,9 @@ export default defineComponent({
socialUrl,
isMultisig,
lztTxHistories,
HistoryTxType,
ccipExplorerUrl,
currentAccount,
};
},
});
Expand Down
6 changes: 3 additions & 3 deletions src/components/bridge/BridgeSelection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<div class="row--logo-bg">
<div class="img--logo-bg">
<img
class="img--logo-astr"
:src="require('src/assets/img/token/astr.png')"
alt="astr"
class="img--logo-soneium"
:src="require('src/assets/img/chain/soneium-color.svg')"
alt="soneium"
/>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/bridge/ccip/Ccip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
:is-gas-payable="Boolean(isGasPayable)"
@update:isApproveMaxAmount="(value: boolean) => (isApproveMaxAmount = value)"
/>
<information :transfer-type="HistoryTxType.LZ_BRIDGE" :is-history="true" />
<information :transfer-type="HistoryTxType.CCIP_BRIDGE" :is-history="false" />
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/bridge/ccip/CcipBridge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</span>
</q-tooltip>
</div>
<div class="box--input-field">
<div class="box--input-field row--reverse-bottom">
<div class="box__space-between">
<span> {{ $t('to') }}</span>
<div>
Expand Down
17 changes: 13 additions & 4 deletions src/components/bridge/ccip/styles/ccip-bridge.scss
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
}

.token-logo {
margin-top: -10px;
width: 24px;
height: 24px;
img {
Expand Down Expand Up @@ -135,7 +136,11 @@
display: flex;
justify-content: center;
position: relative;
margin-top: 16px;
z-index: 10;
}

.row--reverse-bottom {
margin-top: -16px;
}

.icon--reverse {
Expand All @@ -150,7 +155,7 @@
border: 1px solid $gray-4;
cursor: pointer !important;
margin-top: -24px;
background: transparent;
background: $white;
transition: all 0.3s ease 0s;
&:hover {
border: 1px solid $astar-blue !important;
Expand Down Expand Up @@ -243,12 +248,16 @@
input {
color: white;
}
.box--input-field,
.icon--reverse {
.box--input-field {
background: transparent;
border: 1px solid $gray-3;
}

.icon--reverse {
background: $navy-4;
border: 1px solid $gray-3;
}

.row--box-error {
background: $box-red-dark;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/bridge/ethereum/L1Bridge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</span>
</q-tooltip>
</div>
<div class="box--input-field">
<div class="box--input-field row--reverse-bottom">
<div class="box__space-between">
<span> {{ $t('to') }}</span>
<div>
Expand Down
17 changes: 13 additions & 4 deletions src/components/bridge/ethereum/styles/l1-bridge.scss
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@
display: flex;
justify-content: center;
position: relative;
margin-top: 16px;
z-index: 10;
}

.row--reverse-bottom {
margin-top: -16px;
}

.icon--reverse {
Expand All @@ -150,7 +154,7 @@
border: 1px solid $gray-4;
cursor: pointer !important;
margin-top: -24px;
background: transparent;
background: $white;
transition: all 0.3s ease 0s;
&:hover {
border: 1px solid $astar-blue !important;
Expand Down Expand Up @@ -243,12 +247,17 @@
input {
color: white;
}
.box--input-field,
.icon--reverse {

.box--input-field {
background: transparent;
border: 1px solid $gray-3;
}

.icon--reverse {
background: $navy-4;
border: 1px solid $gray-3;
}

.row--box-error {
background: $box-red-dark;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/bridge/layerzero/LzBridge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</span>
</q-tooltip>
</div>
<div class="box--input-field">
<div class="box--input-field row--reverse-bottom">
<div class="box__space-between">
<span> {{ $t('to') }}</span>
<div>
Expand Down
16 changes: 12 additions & 4 deletions src/components/bridge/layerzero/styles/lz-bridge.scss
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@
display: flex;
justify-content: center;
position: relative;
margin-top: 16px;
z-index: 10;
}

.row--reverse-bottom {
margin-top: -16px;
}

.icon--reverse {
Expand All @@ -150,7 +154,7 @@
border: 1px solid $gray-4;
cursor: pointer !important;
margin-top: -24px;
background: transparent;
background: $white;
transition: all 0.3s ease 0s;
&:hover {
border: 1px solid $astar-blue !important;
Expand Down Expand Up @@ -243,12 +247,16 @@
input {
color: white;
}
.box--input-field,
.icon--reverse {
.box--input-field {
background: transparent;
border: 1px solid $gray-3;
}

.icon--reverse {
background: $navy-4;
border: 1px solid $gray-3;
}

.row--box-error {
background: $box-red-dark;
}
Expand Down
4 changes: 4 additions & 0 deletions src/components/bridge/styles/bridge-selection.scss
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@
height: 48px;
}

.img--logo-soneium {
height: 32px;
}

.row--bridge-title {
text-align: left;
}
Expand Down
15 changes: 2 additions & 13 deletions src/hooks/bridge/useCcipBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from 'src/modules/ccip-bridge';
import { showLoading } from 'src/modules/extrinsic/utils';
import { useStore } from 'src/store';
import { WatchCallback, computed, onUnmounted, ref, watch, watchEffect } from 'vue';
import { WatchCallback, computed, onUnmounted, ref, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import { useEthProvider } from '../custom-signature/useEthProvider';
import { EthereumProvider } from '../types/CustomSignature';
Expand Down Expand Up @@ -252,21 +252,10 @@ export const useCcipBridge = () => {
token: selectedToken.value,
});

// if (isHex(hash)) {
// addLzHistories({
// hash: hash,
// type: HistoryTxType.LZ_BRIDGE,
// address: currentAccount.value,
// amount: bridgeAmt.value,
// symbol: selectedToken.value.symbol,
// fromChainId: fromChainId.value,
// toChainId: toChainId.value,
// });
// }

await setIsApproved();
bridgeAmt.value = '';
isApproveMaxAmount.value = false;
await setBridgeBalance();
return hash;
};

Expand Down
2 changes: 1 addition & 1 deletion src/i18n/en-US/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ export default {
ccipMinatoBridge: {
title: 'Soneium Bridge',
tag: 'SBY',
text: 'Transfer assets between Shibuya EVM and Soneium Minato testnet.',
text: 'Transfer SBY between Soneium Minato and Shibuya EVM. Powered by CCIP.',
text2: 'Available on Shibuya EVM. Switch the network to use it.',
},
astarBridge: {
Expand Down
2 changes: 2 additions & 0 deletions src/links/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ export const polkadotJsUrl = {

export const lfgmUrl = 'https://lfgm.astar.network';

export const ccipExplorerUrl = 'https://ccip.chain.link';

export const getSubscanExtrinsic = ({
subscanBase,
hash,
Expand Down
1 change: 1 addition & 0 deletions src/modules/account/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export enum HistoryTxType {
Xvm = 'XVM Transfer',
ZK_ETHEREUM_BRIDGE = 'ZK Ethereum Bridge',
LZ_BRIDGE = 'LayerZero Bridge',
CCIP_BRIDGE = 'CCIP Bridge',
}

export interface TxHistory {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/ccip-bridge/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const ccipBridgeAddress = {
export const ccipBridgeIcon = {
[CcipNetworkName.ShibuyaEvm]: require('src/assets/img/chain/astar.png'),
[CcipNetworkName.AstarEvm]: require('src/assets/img/chain/astar.png'),
[CcipNetworkName.SoneiumMinato]: require('src/assets/img/chain/astar.png'),
[CcipNetworkName.SoneiumMinato]: require('src/assets/img/chain/soneium-black.svg'),
[CcipNetworkName.Soneium]: require('src/assets/img/chain/astar.png'),
} as any;

Expand Down

0 comments on commit 6111c9c

Please sign in to comment.