Skip to content

Commit

Permalink
🎉 copypasted moonsama from bsx
Browse files Browse the repository at this point in the history
  • Loading branch information
vikiival committed Jun 28, 2022
1 parent 6381a05 commit e7cdc11
Show file tree
Hide file tree
Showing 7 changed files with 273 additions and 0 deletions.
50 changes: 50 additions & 0 deletions pages/moonsama/collection/_id.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<template>
<CollectionItem />
</template>

<script lang="ts">
import { Component, Vue } from 'nuxt-property-decorator'
import CollectionItem from '@/components/rmrk/Gallery/CollectionItem.vue'
import { generateCollectionImage } from '~/utils/seoImageGenerator'
type CurrentCollection = {
name: string
numberOfItems: number
image: string
description: string
}
@Component<CollectionItemPage>({
name: 'CollectionItemPage',
components: {
CollectionItem,
},
head() {
const title = this.currentlyViewedCollection.name
const metaData = {
title,
type: 'profile',
description: this.currentlyViewedCollection.description,
url: this.$route.path,
image: this.image,
}
return {
title,
meta: [...this.$seoMeta(metaData)],
}
},
})
export default class CollectionItemPage extends Vue {
get currentlyViewedCollection(): CurrentCollection {
return this.$store.getters['history/getCurrentlyViewedCollection']
}
get image(): string {
return generateCollectionImage(
this.currentlyViewedCollection.name,
this.currentlyViewedCollection.numberOfItems,
this.currentlyViewedCollection.image
)
}
}
</script>
45 changes: 45 additions & 0 deletions pages/moonsama/create.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<template>
<section>
<br />
<b-tabs v-model="activeTab" destroy-on-hide expanded>
<b-tab-item v-for="x in components" :key="x" :label="x">
<component
:is="x"
@navigateToCreateNftTab="switchToCreateNFT"
v-if="components[activeTab] === x" />
</b-tab-item>
</b-tabs>
</section>
</template>

<script lang="ts">
import { Component, mixins } from 'nuxt-property-decorator'
import CreateMixin from '~/utils/mixins/createMixin'
const Collection = () => import('@/components/bsx/Create/Create.vue')
const NFT = () => import('@/components/bsx/Create/CreateToken.vue')
const components = { Collection, NFT }
@Component<BsxCreatePage>({
components,
layout() {
return 'centered-half-layout'
},
head() {
const title = 'KodaDot | Low fees and low carbon minting'
const metaData = {
title,
type: 'article',
description: 'Create carbonless NFTs with low on-chain fees',
url: '/statemine/create',
image: `${this.$config.baseUrl}/k_card_mint.png`,
}
return {
title,
meta: [...this.$seoMeta(metaData)],
}
},
})
export default class BsxCreatePage extends mixins(CreateMixin) {}
</script>
53 changes: 53 additions & 0 deletions pages/moonsama/detail/_id.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<template>
<GalleryItem />
</template>

<script lang="ts">
import { Component, Vue } from 'nuxt-property-decorator'
import GalleryItem from '@/components/rmrk/Gallery/GalleryItem.vue'
import { generateNftImage } from '@/utils/seoImageGenerator'
import { formatBalanceEmptyOnZero } from '@/utils/format/balance'
@Component<GalleryItemPage>({
name: 'GalleryItemPage',
components: {
GalleryItem,
},
head() {
const { title, description, author: content } = this.currentlyViewedItem
const metaData = {
title,
type: 'profile',
description,
url: this.$route.path,
image: this.image,
}
return {
title,
meta: [
...this.$seoMeta(metaData),
{
hid: 'og:author',
property: 'og:author',
content,
},
],
}
},
})
export default class GalleryItemPage extends Vue {
get currentlyViewedItem() {
return this.$store.getters['history/getCurrentlyViewedItem']
}
get image(): string {
return generateNftImage(
this.currentlyViewedItem.name,
formatBalanceEmptyOnZero(this.currentlyViewedItem.price),
this.currentlyViewedItem.image,
this.currentlyViewedItem.mimeType
)
}
}
</script>
31 changes: 31 additions & 0 deletions pages/moonsama/explore.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<template>
<ExploreLayout type="rmrk" />
</template>

<script lang="ts">
import { Component, Vue } from 'nuxt-property-decorator'
import ExploreLayout from '@/components/rmrk/ExploreLayout/ExploreLayout.vue'
const components = {
ExploreLayout,
}
@Component<ExploreBsx>({
components,
head() {
const title = 'Low minting fees and carbonless NFTs'
const metaData = {
title,
type: 'profile',
description: 'Buy Carbonless NFTs on Kusama',
url: '/moonsama/explore',
image: `${this.$config.baseUrl}/k_card_collections.png`,
}
return {
title,
meta: [...this.$seoMeta(metaData)],
}
},
})
export default class ExploreBsx extends Vue {}
</script>
53 changes: 53 additions & 0 deletions pages/moonsama/gallery/_id.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<template>
<GalleryItem />
</template>

<script lang="ts">
import { Component, Vue } from 'nuxt-property-decorator'
import GalleryItem from '@/components/bsx/Gallery/Item/GalleryItem.vue'
import { generateNftImage } from '@/utils/seoImageGenerator'
import { formatBalanceEmptyOnZero } from '@/utils/format/balance'
@Component<GalleryItemPage>({
name: 'GalleryItemPage',
components: {
GalleryItem,
},
head() {
const title = this.currentlyViewedItem.title
const metaData = {
title,
type: 'profile',
description: this.currentlyViewedItem.description,
url: this.$route.path,
image: this.image,
}
return {
title,
meta: [
...this.$seoMeta(metaData),
{
hid: 'og:author',
property: 'og:author',
content: this.currentlyViewedItem.author,
},
],
}
},
})
export default class GalleryItemPage extends Vue {
get currentlyViewedItem() {
return this.$store.getters['history/getCurrentlyViewedItem']
}
get image(): string {
return generateNftImage(
this.currentlyViewedItem.name,
formatBalanceEmptyOnZero(this.currentlyViewedItem.price),
this.currentlyViewedItem.image,
this.currentlyViewedItem.mimeType
)
}
}
</script>
23 changes: 23 additions & 0 deletions pages/moonsama/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<script lang="ts">
import { Component, Vue } from 'nuxt-property-decorator'
@Component({
components: {},
})
export default class LandingPage extends Vue {
layout() {
return 'full-width-layout'
}
middleware({ store, redirect }) {
// If the user is not authenticated
const prefix = store.getters.currentUrlPrefix
if (prefix !== 'moonsama') {
this.$consola.log('Not Moonsama')
store.dispatch('setUrlPrefix', 'moonsama')
}
redirect('/')
}
}
</script>
18 changes: 18 additions & 0 deletions pages/moonsama/u/_id.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<template>
<ProfileDetail />
</template>

<script lang="ts">
import { Component, Vue } from 'nuxt-property-decorator'
import ProfileDetail from '@/components/rmrk/Profile/ProfileDetail.vue'
const components = {
ProfileDetail,
}
@Component<ProfilePage>({
name: 'ProfilePage',
components,
})
export default class ProfilePage extends Vue {}
</script>

0 comments on commit e7cdc11

Please sign in to comment.