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

feat: 💄 release redesigned landing page #4127

Merged
merged 7 commits into from
Oct 19, 2022
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
6 changes: 3 additions & 3 deletions components/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -246,16 +246,16 @@ export default class NavbarMenu extends mixins(
return this.$store.getters['history/getCurrentlyViewedItem']?.name || ''
}

get isRedesignedLandingPage() {
return this.$route.name === 'index' && this.redesign
get isLandingPage() {
return this.$route.name === 'index'
}
Jarsen136 marked this conversation as resolved.
Show resolved Hide resolved

get logoSrc() {
return this.$colorMode.preference === 'dark' ? KodaBetaDark : KodaBeta
}

get showSearchOnNavbar(): boolean {
return !this.isRedesignedLandingPage || !this.showTopNavbar
return !this.isLandingPage || !this.showTopNavbar
}

get navBarTitle(): string {
Expand Down
127 changes: 0 additions & 127 deletions components/TheFooterOld.vue

This file was deleted.

98 changes: 1 addition & 97 deletions components/carousel/CarouselIndex.vue
Original file line number Diff line number Diff line change
@@ -1,60 +1,20 @@
<template>
<div>
<div v-if="redesign && nfts.length">
<div v-if="nfts.length">
<h2 class="title is-2 has-text-dark">{{ title }}</h2>

<CarouselList v-if="showCarousel" :nfts="nfts" />
</div>

<div v-if="!redesign && nfts.length" class="my-5">
<Loader v-model="isLoading" />

<div class="columns is-vcentered">
<div class="column is-four-fifths">
<h1 class="title is-2">{{ title }}</h1>
<p class="subtitle is-size-5">{{ subtitle }}</p>
</div>

<div class="column has-text-right">
<Pagination
v-if="actionType === 'pagination'"
v-model="page"
simple
preserve-scroll
:total="totalItems"
:per-page="1" />
</div>
<b-button
v-if="actionType === 'link' && linkUrl && linkText"
tag="nuxt-link"
type="is-primary"
inverted
outlined
icon-right="chevron-right"
:to="linkUrl">
{{ linkText }}
</b-button>
</div>

<CarouselListOld :nfts="nfts" :page="page" :options="options" />
</div>
</div>
</template>

<script lang="ts" setup>
import Pagination from '@/components/rmrk/Gallery/Pagination.vue'

import type { CarouselNFT } from '@/components/base/types'
import type { RowSeries } from '@/components/series/types'

const CarouselList = defineAsyncComponent(
() => import('./module/CarouselAgnostic.vue')
)
const CarouselListOld = defineAsyncComponent(
() => import('./module-old/CarouselList.vue')
)

const { redesign } = useExperiments()

const props = defineProps<{
title?: string
Expand All @@ -70,61 +30,5 @@ const props = defineProps<{
const itemUrl = computed(() => props.itemUrl || 'gallery')
provide('itemUrl', itemUrl.value)

const page = ref(1)
const isLoading = computed(() => props.loading)
const total = ref(props.nfts.length)
const totalItems = computed(() => total.value)
const showCarousel = computed(() => props.nfts.length)
const options = {
itemsToShow: 2,
breakpoints: {
300: {
itemsToShow: 1,
},
600: {
itemsToShow: 1.5,
},
800: {
itemsToShow: 2,
},
900: {
itemsToShow: 2.5,
},
1000: {
itemsToShow: 3,
},
1400: {
itemsToShow: 4,
},
1800: {
itemsToShow: 4.5,
},
2800: {
itemsToShow: 5,
},
},
}
const breakpoints = Object.keys(options.breakpoints).reverse()

// adjust total based on breakpoints
const updateTotal = () => {
const width = window.innerWidth

for (const breakpoint of breakpoints) {
if (parseInt(breakpoint) <= width) {
const items = options.breakpoints[breakpoint].itemsToShow
total.value = Math.round(props.nfts.length - items + 1)
break
}
}
}

watch(
() => props.nfts,
() => {
if (props.nfts.length && props.actionType === 'pagination') {
updateTotal()
}
}
)
</script>
10 changes: 2 additions & 8 deletions components/carousel/CarouselTypeLatestSales.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,8 @@

<script lang="ts" setup>
import CarouselIndex from './CarouselIndex.vue'
import {
useCarouselNftEvents,
useCarouselNftEventsOld,
} from './utils/useCarousel'
import { useCarouselNftEvents } from './utils/useCarousel'

const { redesign } = useExperiments()
const { urlPrefix } = usePrefix()
const { nfts } = redesign.value
? useCarouselNftEvents({ type: 'latestSales' })
: useCarouselNftEventsOld({ type: 'latestSales' })
const { nfts } = useCarouselNftEvents({ type: 'latestSales' })
</script>
10 changes: 2 additions & 8 deletions components/carousel/CarouselTypeNewestList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,8 @@

<script lang="ts" setup>
import CarouselIndex from './CarouselIndex.vue'
import {
useCarouselNftEvents,
useCarouselNftEventsOld,
} from './utils/useCarousel'
import { useCarouselNftEvents } from './utils/useCarousel'

const { redesign } = useExperiments()
const { urlPrefix } = usePrefix()
const { nfts } = redesign.value
? useCarouselNftEvents({ type: 'newestList' })
: useCarouselNftEventsOld({ type: 'newestList' })
const { nfts } = useCarouselNftEvents({ type: 'newestList' })
</script>
31 changes: 0 additions & 31 deletions components/carousel/module-old/CarouselCardFooter.vue

This file was deleted.

52 changes: 0 additions & 52 deletions components/carousel/module-old/CarouselCardInfo.vue

This file was deleted.

Loading