Skip to content

Commit

Permalink
refactor(metagarden): move pages
Browse files Browse the repository at this point in the history
  • Loading branch information
shrpne committed Jan 26, 2023
1 parent 960bd77 commit 72104d0
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 33 deletions.
2 changes: 1 addition & 1 deletion data/cards-raw.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default {
description: 'metagarden — a play-to-earn platform with mini games. Become the platform miner to earn crypto.',
buttonLabel: 'Buy spot',
tags: [],
action: `/metagarden-buy-spot`,
action: `/metagarden/buy-spot`,
ru: {
caption: 'Майнинг',
title: 'Майнинг-споты',
Expand Down
2 changes: 2 additions & 0 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ module.exports = {
router: {
linkActiveClass: 'is-active-inner',
linkExactActiveClass: 'is-active',
// fix foo-bar.vue shadowing foo/bar.vue, by default they have same name, so change '-' separator to '/'
routeNameSplitter: '/',
middleware: [
'auth',
'history',
Expand Down
8 changes: 7 additions & 1 deletion pages/go/_game/_entropy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ export default {
store.commit('LOGOUT');
store.commit('ADD_AUTH_ADVANCED', mnemonic);
return app.router.replace(app.i18nGetPreferredPath('/' + game));
return app.router.replace(app.i18nGetPreferredPath('/' + game))
.catch((error) => {
// fix error on double redirect @see https://stackoverflow.com/a/65326844
if (error.type !== app.router.constructor.NavigationFailureType.redirected) {
throw error;
}
});
},
};
</script>
Expand Down
35 changes: 4 additions & 31 deletions pages/metagarden-buy-spot.vue
Original file line number Diff line number Diff line change
@@ -1,41 +1,14 @@
<script>
import ActionMetagardenBuySpot from '~/components/ActionMetagardenBuySpot.vue';
export default {
components: {
ActionMetagardenBuySpot,
},
data() {
return {
};
},
computed: {
layout: 'splash',
asyncData({redirect, app}) {
return redirect(app.i18nGetPreferredPath('/metagarden/buy-spot'));
},
};
</script>

<template>
<div class="u-section u-container u-container--small">
<div class="card card--invert">
<div class="card__content card__content--medium">
<h1 class="card__action-title-value">{{ $td('Buy metagarden mining spots', 'metagarden.title') }}</h1>
<p class="card__action-description u-mt-05">
{{ $td('One spot costs $80 or 1000 METAGARDEN tokens', 'metagarden.description') }}
</p>
</div>

<div class="card card--pop card--light-grey">
<ActionMetagardenBuySpot
class="card__content card__content--medium"
@success-modal-close="$router.push($getDashboardUrl())"
/>


<!-- <div class="card__content card__content&#45;&#45;medium u-text-medium">
<h3 class="u-h5 u-mb-05">Terms & Conditions</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Massa pellentesque donec in mus mi massa fusce netus. Nec gravida faucibus pellentesque aliquam consequat sed. Dignissim suspendisse blandit lacinia amet. Cras tincidunt nec maecenas eleifend nisl tristique volutpat enim habitant.</p>
</div>-->
</div>
</div>
Loading…
</div>
</template>
File renamed without changes.
41 changes: 41 additions & 0 deletions pages/metagarden/buy-spot.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<script>
import ActionMetagardenBuySpot from '~/components/ActionMetagardenBuySpot.vue';
export default {
components: {
ActionMetagardenBuySpot,
},
data() {
return {
};
},
computed: {
},
};
</script>

<template>
<div class="u-section u-container u-container--small">
<div class="card card--invert">
<div class="card__content card__content--medium">
<h1 class="card__action-title-value">{{ $td('Buy metagarden mining spots', 'metagarden.title') }}</h1>
<p class="card__action-description u-mt-05">
{{ $td('One spot costs $80 or 1000 METAGARDEN tokens', 'metagarden.description') }}
</p>
</div>

<div class="card card--pop card--light-grey">
<ActionMetagardenBuySpot
class="card__content card__content--medium"
@success-modal-close="$router.push($getDashboardUrl())"
/>


<!-- <div class="card__content card__content&#45;&#45;medium u-text-medium">
<h3 class="u-h5 u-mb-05">Terms & Conditions</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Massa pellentesque donec in mus mi massa fusce netus. Nec gravida faucibus pellentesque aliquam consequat sed. Dignissim suspendisse blandit lacinia amet. Cras tincidunt nec maecenas eleifend nisl tristique volutpat enim habitant.</p>
</div>-->
</div>
</div>
</div>
</template>
14 changes: 14 additions & 0 deletions pages/metagarden/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<script>
export default {
layout: 'splash',
asyncData({redirect, app}) {
return redirect(app.i18nGetPreferredPath('/metagarden/buy-spot'));
},
};
</script>

<template>
<div class="u-section u-container u-container--small">
Loading…
</div>
</template>

0 comments on commit 72104d0

Please sign in to comment.