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

Release hotfix to main #1189

Merged
merged 4 commits into from
Feb 16, 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
20 changes: 1 addition & 19 deletions src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import {
createWebHistory,
} from 'vue-router';
import { StateInterface } from 'src/store';
import routes, { Path } from 'src/router/routes';
import { $api } from '../boot/api';
import routes from 'src/router/routes';
export { Path } from 'src/router/routes';
export { getHeaderName, buildTransferPageLink } from 'src/router/utils';

Expand Down Expand Up @@ -38,22 +37,5 @@ export default route<StateInterface>(function (/* { store, ssrContext } */) {
history: createHistory(process.env.MODE === 'ssr' ? void 0 : process.env.VUE_ROUTER_BASE),
});

// TODO - remove after the portal v3 is live.
Router.beforeEach((to, from, next) => {
// Prevent accessing to dApp staking pages if v3 is deployed to a node, but not supported by UI
const networksSupportV3 = ['development', 'shibuya-testnet', 'custom-node', 'shiden'];
const isStakingV3 = $api?.query.hasOwnProperty('dappStaking');
const dontNavigateToDappStaking =
to.path.includes('/dapp-staking') &&
!to.path.includes('/maintenance') &&
!networksSupportV3.includes(to.params?.network?.toString());

if (isStakingV3 && dontNavigateToDappStaking) {
next({ path: Path.DappStaking + Path.Maintenance });
} else {
next();
}
});

return Router;
});
8 changes: 1 addition & 7 deletions src/router/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import XvmTransfer from 'pages/XvmTransfer.vue';
import { endpointKey, getNetworkName } from 'src/config/chainEndpoints';
import { LOCAL_STORAGE } from 'src/config/localStorage';
import Store from 'src/pages/DappStaking.vue';
import StakingTop from 'components/dapp-staking/StakingTop.vue';
import Dashboard from 'src/pages/Dashboard.vue';
import RegisterDapp from 'src/pages/RegisterDapp.vue';
import StakeManage from 'src/pages/StakeManage.vue';
Expand Down Expand Up @@ -153,12 +152,7 @@ const routes: RouteRecordRaw[] = [
},
{
path: 'discover',
component:
networkParam === '/development' ||
networkParam === '/shibuya-testnet' ||
networkParam === '/shiden'
? DiscoverV3
: StakingTop,
component: DiscoverV3,
},
{
path: 'owner',
Expand Down
Binary file added src/staking-v3/assets/category_unstoppable.webp
Binary file not shown.
1 change: 1 addition & 0 deletions src/staking-v3/components/Dapps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export default defineComponent({
tooling: require('/src/staking-v3/assets/category_blue.webp'),
utility: require('/src/staking-v3/assets/category_sky.webp'),
others: require('/src/staking-v3/assets/category_green.webp'),
'unstoppable-grants': require('/src/staking-v3/assets/category_unstoppable.webp'),
};

return {
Expand Down
1 change: 0 additions & 1 deletion src/staking-v3/components/DiscoverV3.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ import LeaderboardVote from './leaderboard/LeaderboardVote.vue';
import DynamicAdsArea from './DynamicAdsArea.vue';
import ToggleButtons from './ToggleButtons.vue';
import DataList from './data/DataList.vue';
import RegisterBanner from './RegisterBanner.vue';
import { useDappStaking } from '../hooks';

export default defineComponent({
Expand Down
26 changes: 26 additions & 0 deletions src/staking-v3/components/DynamicAdsArea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,29 @@ export default defineComponent({
<style lang="scss" scoped>
@import './styles/ads-area.scss';
</style>

<style lang="scss">
.swiper--ads-area {
.swiper-button-prev,
.swiper-button-next {
color: white;
width: 40px;
height: 40px;
border-radius: 20px;
background-color: $navy-1;
&::after {
font-size: 12px;
font-weight: 600;
}
}
.swiper-button-prev {
padding-right: 2px;
}
.swiper-button-next {
padding-left: 2px;
}
.swiper-button-disabled {
display: none;
}
}
</style>
6 changes: 3 additions & 3 deletions src/staking-v3/components/dapp/DappAvatar.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<template>
<div :class="`wrapper--dapp-avatar ${small ? 'small' : ''}`">
<div class="column--avatar">
<div>
<img class="image--dapp-icon" :src="dapp.extended?.iconUrl" :alt="dapp.extended?.name" />
<div class="image--dapp-icon">
<img :src="dapp.extended?.iconUrl" :alt="dapp.extended?.name" />
</div>
<div class="column--details">
<div class="row--dapp-title">
{{ dapp.extended?.name }}
</div>
<div v-if="!small" class="row--dapp-description">
{{ dapp.extended?.description }}
{{ dapp.extended?.shortDescription }}
</div>
<div v-if="dapp.extended?.tags && !small" class="row--tags">
<div v-for="tag in dapp.extended?.tags" :key="tag" class="tag">
Expand Down
12 changes: 8 additions & 4 deletions src/staking-v3/components/dapp/styles/builders.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,16 @@
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
@media (min-width: $sm) {
grid-template-columns: repeat(4, minmax(0, 1fr));
grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (min-width: $lg) {
display: flex;
flex-wrap: wrap;
grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (min-width: $xl) {
grid-template-columns: repeat(5, minmax(0, 1fr));
}
@media (min-width: $xxl) {
grid-template-columns: repeat(6, minmax(0, 1fr));
}
}

Expand All @@ -84,7 +89,6 @@
flex-direction: column;
gap: 12px;
@media (min-width: $lg) {
width: 200px;
padding: 24px 32px;
}
}
Expand Down
27 changes: 16 additions & 11 deletions src/staking-v3/components/dapp/styles/dapp-avatar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@
}

.image--dapp-icon {
width: 120px;
height: 120px;
border-radius: 16px;
object-fit: contain;
overflow: hidden;
margin: auto;
flex-shrink: 0;
img {
width: 120px;
height: 120px;
border-radius: 16px;
object-fit: contain;
overflow: hidden;
margin: auto;
}
}

.row--dapp-title {
Expand Down Expand Up @@ -129,11 +132,13 @@
}
}
.image--dapp-icon {
width: 44px;
height: 44px;
@media (min-width: $sm) {
width: 60px;
height: 60px;
img {
width: 44px;
height: 44px;
@media (min-width: $sm) {
width: 60px;
height: 60px;
}
}
}
.row--dapp-title {
Expand Down
14 changes: 12 additions & 2 deletions src/staking-v3/components/styles/dapps.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,24 @@
.text--title {
font-weight: 700;
font-size: 16px;
margin: 12px 0 8px 0;
margin: 0 0 4px 0;
line-height: 1.25;
overflow: hidden;
display: -webkit-box;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
}

.text--description {
color: $navy-4;
font-size: 12px;
font-weight: 500;
overflow: hidden;
display: -webkit-box;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
}

.card__bottom {
Expand Down Expand Up @@ -161,7 +171,7 @@
.title--category {
width: 60%;
backdrop-filter: blur(20px);
padding: 24px;
padding: 18px;
background-color: rgba(255, 255, 255, 0.05);
color: white;
font-size: 24px;
Expand Down
3 changes: 2 additions & 1 deletion src/staking-v3/hooks/useDappStaking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,8 @@ export function useDappStaking() {
return [false, t('stakingV3.dappStaking.TooManyStakedContracts')];
} else if (
constants.value?.minStakeAmountToken &&
stake.amount < constants.value.minStakeAmountToken
stake.amount < constants.value.minStakeAmountToken &&
getStakerInfo(stake.address) === undefined
) {
return [
false,
Expand Down
2 changes: 1 addition & 1 deletion src/staking-v3/logic/repositories/DappStakingRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ export class DappStakingRepository implements IDappStakingRepository {
public async batchAllCalls(calls: ExtrinsicPayload[]): Promise<ExtrinsicPayload> {
const api = await this.api.getApi();

return api.tx.utility.batchAll(calls);
return calls.length === 1 ? calls[0] : api.tx.utility.batchAll(calls);
}

public async getCurrentEraInfo(): Promise<EraInfo> {
Expand Down
Loading