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

Add Shibuya Scope Style #1078

Merged
merged 35 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
808c350
add feature dApp area style
ayumitk Dec 6, 2023
3e74e53
add dapps list and data list area style
ayumitk Dec 6, 2023
df766a5
add ad area style
ayumitk Dec 6, 2023
68e0de8
add Leaderboard area style
ayumitk Dec 6, 2023
92cf9ae
move staking section to assets page
ayumitk Dec 6, 2023
c01cdf9
update the your projects section style on the assets page
ayumitk Dec 9, 2023
f1098f4
move css files
ayumitk Dec 9, 2023
3b2ecf0
add staking section style on the assets page
ayumitk Dec 9, 2023
cb6161e
add vote and stake page style
ayumitk Dec 9, 2023
c6c0294
Merge branch 'feat/dapp-staking-v3' into feat/shibuya-scope-style
ayumitk Dec 9, 2023
00be48b
adjust tvl text size
ayumitk Dec 9, 2023
3f753ec
add owner page style
ayumitk Dec 10, 2023
bdf1f9b
update astar ui
ayumitk Dec 11, 2023
4d298fa
remove dark theme style from the vote page
ayumitk Dec 11, 2023
4340a15
update vote page style
ayumitk Dec 11, 2023
7599918
Merge branch 'feat/dapp-staking-v3' into feat/shibuya-scope-style
ayumitk Dec 12, 2023
cb8e42e
remove dark theme from dapp staking pages
ayumitk Dec 12, 2023
b5730ed
add project page style
ayumitk Dec 12, 2023
b3bdeb0
clean up
ayumitk Dec 12, 2023
db73c0e
Merge branch 'feat/dapp-staking-v3' into feat/shibuya-scope-style
ayumitk Dec 12, 2023
e1cc876
add Leaderboard style
ayumitk Dec 14, 2023
4887e4f
update dapp style
ayumitk Dec 14, 2023
2aa6563
update lang
ayumitk Dec 14, 2023
c9085e5
add input search
ayumitk Dec 14, 2023
f3a8dcd
update
ayumitk Dec 15, 2023
5688ba1
Merge branch 'feat/dapp-staking-v3' into feat/shibuya-scope-style
ayumitk Dec 15, 2023
9bece66
update leaderboard style
ayumitk Dec 15, 2023
0834289
add category style
ayumitk Dec 15, 2023
609fd53
add tier paging
ayumitk Dec 15, 2023
55e580d
Small fix for loading a dApp
bobo-k2 Dec 15, 2023
88c3a6b
Changed a way how to subscribe and handle protocol state
bobo-k2 Dec 15, 2023
8947a54
clean up
ayumitk Dec 15, 2023
ccb7070
update dapps search logic
ayumitk Dec 15, 2023
64ed4be
Merge branch 'feat/dapp-staking-v3' into feat/shibuya-scope-style
bobo-k2 Dec 20, 2023
696e13d
remove operator from filter function
ayumitk Dec 20, 2023
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"dependencies": {
"@astar-network/astar-sdk-core": "^0.2.7",
"@astar-network/astar-ui": "^0.0.136",
"@astar-network/astar-ui": "^0.0.137",
"@astar-network/metamask-astar-adapter": "^0.5.4",
"@astar-network/metamask-astar-types": "^0.6.1",
"@ethersproject/bignumber": "^5.5.0",
Expand Down
40 changes: 22 additions & 18 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
// https://polkadot.js.org/docs/api/FAQ/#since-upgrading-to-the-7x-series-typescript-augmentation-is-missing
import 'reflect-metadata';
import '@polkadot/api-augment';
import { defineComponent, computed, ref, watch } from 'vue';
import { defineComponent, computed, ref, watch, onMounted } from 'vue';
import DashboardLayout from 'layouts/DashboardLayout.vue';
import DecentralizedBanner from 'src/components/common/DecentralizedBanner.vue';
import { useStore } from 'src/store';
Expand Down Expand Up @@ -146,17 +146,21 @@ export default defineComponent({
});

// **** dApp staking v3
if (isDappStakingV3.value) {
// dApp staking v3 data changed subscriptions.
container
.get<IDappStakingRepositoryV3>(Symbols.DappStakingRepositoryV3)
.startProtocolStateSubscription();

eventAggregator.subscribe(ProtocolStateChangedMessage.name, async (m) => {
const message = m as ProtocolStateChangedMessage;
store.commit('stakingV3/setProtocolState', message.state, { root: true });
// dApp staking v3 data changed subscriptions.
onMounted(() => {
if (isDappStakingV3.value) {
container
.get<IDappStakingRepositoryV3>(Symbols.DappStakingRepositoryV3)
.startProtocolStateSubscription();
}
});

eventAggregator.subscribe(ProtocolStateChangedMessage.name, async (m) => {
const message = m as ProtocolStateChangedMessage;
console.log('protocol state', message.state);

console.log('protocol state', message.state);
if (message.state) {
store.commit('stakingV3/setProtocolState', message.state, { root: true });
await fetchDappsToStore();
await Promise.all([
getAllRewards(),
Expand All @@ -166,14 +170,14 @@ export default defineComponent({
fetchStakerInfoToStore(),
fetchEraLengthsToStore(),
]);
});
}
});

eventAggregator.subscribe(AccountLedgerChangedMessage.name, (m) => {
const message = m as AccountLedgerChangedMessage;
store.commit('stakingV3/setLedger', message.ledger, { root: true });
console.log('ledger', message.ledger);
});
}
eventAggregator.subscribe(AccountLedgerChangedMessage.name, (m) => {
const message = m as AccountLedgerChangedMessage;
store.commit('stakingV3/setLedger', message.ledger, { root: true });
console.log('ledger', message.ledger);
});
// **** end dApp staking v3

// Handle wallet change so we can inject proper wallet
Expand Down
33 changes: 21 additions & 12 deletions src/components/assets/Assets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,26 @@
:is-loading-xcm-assets-amount="isLoadingXcmAssetsAmount"
/>

<div v-if="isDappStakingV3">
<template v-if="isDappStakingV3">
<your-project />
</div>
<div class="container">
<div v-if="isH160">
<evm-asset-list :tokens="evmAssets.assets" />
</div>
<div v-else>
<!-- Memo: hide xvm panel because AA might replace it -->
<!-- <xvm-native-asset-list v-if="isSupportXvmTransfer" :xvm-assets="xvmAssets.xvmAssets" /> -->
<xcm-native-asset-list v-if="isEnableXcm" :xcm-assets="xcmAssets.assets" />
</div>
</div>
</template>

<template v-if="isH160">
<evm-asset-list class="container" :tokens="evmAssets.assets" />
</template>
<template v-else>
<!-- Memo: hide xvm panel because AA might replace it -->
<!-- <xvm-native-asset-list v-if="isSupportXvmTransfer" :xvm-assets="xvmAssets.xvmAssets" /> -->
<xcm-native-asset-list
v-if="isEnableXcm"
class="container"
:xcm-assets="xcmAssets.assets"
/>
</template>

<template v-if="isDappStakingV3">
<staking />
</template>
</div>

<div class="column--links">
Expand All @@ -48,6 +55,7 @@ import { useStore } from 'src/store';
import { EvmAssets, XcmAssets, XvmAssets } from 'src/store/assets/state';
import { Asset } from 'src/v2/models';
import { computed, defineComponent, onUnmounted, ref, watch, watchEffect } from 'vue';
import Staking from 'src/staking-v3/components/my-staking/Staking.vue';

export default defineComponent({
components: {
Expand All @@ -57,6 +65,7 @@ export default defineComponent({
EvmAssetList,
XcmNativeAssetList,
YourProject,
Staking,
},
setup() {
const token = ref<Asset | null>(null);
Expand Down
26 changes: 12 additions & 14 deletions src/components/assets/Rewards.vue
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
<template>
<div>
<button v-if="!isDappDeveloper" class="wrapper--rewards" @click="handleClaim">
<div class="container--rewards">
<div class="text--title">
{{ $t('assets.yourEstimatedRewards') }}
</div>
<div class="row--data">
<div class="value">
<div>
<span class="text--amount">{{ $n(pendingRewards || 0) }}</span>
<span class="text--symbol">{{ nativeTokenSymbol }}</span>
</div>
<button v-if="!isDappDeveloper" class="wrapper--rewards" @click="handleClaim">
<div class="container--rewards">
<div class="text--title">
{{ $t('assets.yourEstimatedRewards') }}
</div>
<div class="row--data">
<div class="value">
<div>
<span class="text--amount">{{ $n(pendingRewards || 0) }}</span>
<span class="text--symbol">{{ nativeTokenSymbol }}</span>
</div>
</div>
</div>
</button>
</div>
</div>
</button>
</template>

<script lang="ts">
Expand Down
3 changes: 2 additions & 1 deletion src/components/assets/YourProject.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<div v-if="ownDapps.length > 0" class="container">
<div class="wrapper--your-project">
<div class="row--title">
<span class="text--title">Your Project</span>
<astar-icon-project />
<span class="text--title">{{ $t('assets.yourProject') }}</span>
</div>
<div class="separator" />
<div class="box--dapps">
Expand Down
55 changes: 28 additions & 27 deletions src/components/assets/styles/your-project.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
}

.box--dapps {
display: flex;
flex-direction: column;
align-items: center;
gap: 32px;
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 16px;

@media (min-width: $sm) {
}
@media (min-width: $md) {
flex-direction: row;
flex-wrap: wrap;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 32px;
}
@media (min-width: $xxl) {
grid-template-columns: repeat(4, minmax(0, 1fr));
}
}

Expand All @@ -29,36 +29,38 @@
}

.row--title {
}

.container {
border: solid 1px $gray-2;
background-color: white;
box-shadow: none;
border-radius: 16px;
padding: 16px 0 24px 0;
@media (min-width: $sm) {
padding-left: 24px;
padding-right: 24px;
display: flex;
align-items: center;
gap: 16px;
svg {
width: 32px;
height: 32px;
}
}

.card--dapp {
cursor: pointer;
width: 182px;
background-color: $gray-1;
border-radius: 16px;
column-gap: 16px;
height: 64px;
column-gap: 10px;
display: flex;
align-items: center;
padding: 16px;
font-size: 16px;
font-weight: 600;
color: $navy-1;
line-height: 1.25;
transition: all 0.2s ease;
&:hover{
background-color: $gray-2;
}
}

.icon--dapp-logo {
width: 32px;
height: 32px;
border-radius: 8px;
object-fit: contain;
}

.separator {
Expand All @@ -69,13 +71,12 @@
}

.body--dark {
.container {
background-color: $navy-1;
border-color: $navy-3;
box-shadow: 0px 3px 8px 0px rgba(0, 0, 0, 0.8);
}
.card--dapp {
background-color: $navy-3;
color: $gray-1;
&:hover{
background-color: lighten($navy-3,5%);
}
}
.separator {
background-color: $navy-3;
Expand Down
6 changes: 6 additions & 0 deletions src/components/common/styles/back-to-page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@
.icon--back {
font-size: 18px;
}

.body--dark{
.container--back {
color: $gray-3;
}
}
7 changes: 7 additions & 0 deletions src/i18n/en-US/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ export default {
removeFromFavorite: 'Remove from favorite',
unifyAccounts: 'Unify accounts',
yourEstimatedRewards: 'Claim your estimated rewards',
yourProject: 'Your Project',
toast: {
completedMessage: 'You have sent {transferAmt} {symbol} to {toAddress}',
completedBridgeMessage: 'You have sent {transferAmt} {symbol} from {fromChain} to {toChain}',
Expand Down Expand Up @@ -741,6 +742,7 @@ export default {
stakeOn: 'Stake on {name}',
tier: 'Tier',
tierLeaderboard: 'Tier Leaderboard',
rewardPerDay: 'Reward per day',
leaderboard: 'Leaderboard',
myStaking: 'My Staking',
myDapps: 'My dApps',
Expand Down Expand Up @@ -792,9 +794,14 @@ export default {
unfilledSlot: 'Unfilled slots',
ourDapps: 'Our dApps',
ourData: 'Our data',
dapp: {
voteAndStake: 'Vote & Stake',
overview: 'Overview',
},
unregisteredDappInfo:
"This project has been unregistered. You don't have to do anything - If you do not move funds within this period, you will continue to earn basic rewards and be entitled to receive bonus.",
voteSuccess: 'You successfully voted to {number} dApp(s). All pending rewards are claimed.',
searchDapps: 'Search dapps',
},
bridge: {
bridge: 'Bridge',
Expand Down
Binary file added src/staking-v3/assets/vote_bg_light.webp
Binary file not shown.
6 changes: 6 additions & 0 deletions src/staking-v3/components/Amount.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,10 @@ export default defineComponent({
height: 24px;
margin-right: 8px;
}

.body--dark {
.text--title {
color: $navy-1;
}
}
</style>
Loading
Loading