Skip to content

Commit

Permalink
Merge pull request #6463 from kodadot/main
Browse files Browse the repository at this point in the history
  • Loading branch information
yangwao authored Jul 25, 2023
2 parents 7b4bb16 + 62174ea commit 56960c1
Show file tree
Hide file tree
Showing 87 changed files with 2,507 additions and 3,274 deletions.
2 changes: 1 addition & 1 deletion .github/diagram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 13 additions & 5 deletions components/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,20 @@ onBeforeUnmount(() => {
</script>

<style lang="scss" scoped>
:deep .navbar-explore .o-drop__item {
padding: 1.5rem 2rem;
min-width: 18.75rem;
:deep .navbar-explore {
.navbar-item {
height: 4.5rem;
}
.o-drop__menu {
margin: 0;
}
.o-drop__item {
padding: 1.5rem 2rem;
min-width: 18.75rem;
&:hover {
background-color: unset;
&:hover {
background-color: unset;
}
}
}
</style>
117 changes: 117 additions & 0 deletions components/blog/BlogPost.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<template>
<div class="article">
<div
class="is-flex is-justify-content-space-between has-text-grey is-size-5">
<div>{{ attributes.tags }}</div>
<div v-if="attributes.date">
{{ format(new Date(attributes.date), 'dd.MM.yyyy') }}
</div>
</div>
<h1>{{ attributes.title }}</h1>
<p v-if="attributes.subtitle" class="subtitle">{{ attributes.subtitle }}</p>
<img
v-if="attributes.image"
:src="attributes.image"
:alt="attributes.title"
width="100%" />
<component :is="singlePostComponent" />
</div>
</template>

<script setup>
import { format } from 'date-fns'
import { convertMarkdownToText } from '@/utils/markdown'
const { $seoMeta } = useNuxtApp()
const route = useRoute()
const slug = route.params.slug
const attributes = ref({})
const singlePostComponent = ref('')
onMounted(async () => {
const post = await import(`~/content/blog/${slug}.md`)
attributes.value = post.attributes
singlePostComponent.value = post.vue.component
})
const title = computed(() => attributes.value.title)
const meta = computed(() => {
return [
...$seoMeta({
title: attributes.value.title,
description: convertMarkdownToText(attributes.value.subtitle),
url: route.path,
image: attributes.value.image,
}),
]
})
useNuxt2Meta({
title,
meta,
})
</script>

<style lang="scss">
@import '@/styles/abstracts/variables';
.article {
margin: 0 auto;
max-width: 40rem;
.subtitle {
font-size: 25px;
margin-bottom: 0;
}
h1 {
font-size: 3rem;
font-weight: 700;
margin: 1rem 0;
}
h2 {
font-size: 1.5rem;
font-weight: bold;
margin-bottom: 1rem;
}
img {
border-radius: 1rem;
margin: 2.5rem 0;
}
p {
font-size: 20px;
line-height: 30px;
margin-bottom: 1rem;
}
@include ktheme() {
.markdown-body {
color: theme('k-accentlight2-dark');
}
img {
border: 1px solid theme('border-color');
}
}
@include touch {
.subtitle {
font-size: 1.25rem;
}
h1 {
font-size: 1.75rem;
}
h2,
p {
font-size: 1rem;
}
}
}
</style>
19 changes: 10 additions & 9 deletions components/bsx/Offer/MyOffer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,17 @@
:label="$t('offer.action')"
width="120"
sortable>
<b-button
<NeoButton
v-if="props.row.caller === accountId"
type="is-orange"
outlined
no-shadow
icon-left="times"
@click="onClick(props.row, true)" />
<b-button
@click.native="onClick(props.row, true)" />
<NeoButton
v-else
type="is-success"
outlined
variant="success"
no-shadow
icon-left="money-bill"
@click="onClick(props.row, false)" />
@click.native="onClick(props.row, false)" />
</NeoTableColumn>
<NeoTableColumn
v-slot="props"
Expand All @@ -90,7 +89,7 @@
import { Component, Emit, Prop, Watch, mixins } from 'nuxt-property-decorator'
import { formatDistanceToNow } from 'date-fns'
import { NeoSelect, NeoTable, NeoTableColumn } from '@kodadot1/brick'
import { NeoButton, NeoSelect, NeoTable, NeoTableColumn } from '@kodadot1/brick'
import { tokenIdToRoute } from '@/components/unique/utils'
Expand All @@ -107,6 +106,7 @@ const components = {
NeoTable,
NeoTableColumn,
NeoSelect,
NeoButton,
}
@Component({
Expand Down Expand Up @@ -179,6 +179,7 @@ export default class MyOffer extends mixins(PrefixMixin, OfferMixin) {
}
}
</script>

<style scoped>
.limit-width-text {
max-width: 50ch;
Expand Down
14 changes: 8 additions & 6 deletions components/bsx/Offer/OfferTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,17 @@
:label="$t('offer.expired')"
:active="calcExpirationTime(props.row.expiration) === 'expired'"
class="mr-2">
<b-button
type="is-success"
outlined
<NeoButton
variant="success"
no-shadow
icon-left="money-bill"
:disabled="calcExpirationTime(props.row.expiration) === 'expired'"
@click="tellFrens(props.row.caller, false)" />
</NeoTooltip>
<b-button
<NeoButton
v-if="props.row.caller === accountId || isOwner"
type="is-orange"
outlined
variant="warning"
no-shadow
icon-left="times"
@click="tellFrens(props.row.caller, true)" />
</div>
Expand Down Expand Up @@ -153,6 +153,7 @@ import OfferMixin from '@/utils/mixins/offerMixin'
import PrefixMixin from '@/utils/mixins/prefixMixin'
import { getKusamaAssetId } from '@/utils/api/bsx/query'
import {
NeoButton,
NeoSelect,
NeoTable,
NeoTableColumn,
Expand All @@ -167,6 +168,7 @@ const components = {
NeoTableColumn,
NeoTooltip,
NeoSelect,
NeoButton,
}
@Component({ components, filters: { formatDistanceToNow } })
Expand Down
10 changes: 5 additions & 5 deletions components/bsx/Offer/OffersUserTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,11 @@
v-slot="props"
:label="$t('offer.action')"
width="120">
<b-button
<NeoButton
v-if="props.row.status === 'ACTIVE'"
type="is-orange"
outlined
no-shadow
icon-left="times"
@click="withdrawOffer(props.row)" />
@click.native="withdrawOffer(props.row)" />
</NeoTableColumn>
</NeoTable>
</div>
Expand All @@ -81,7 +80,7 @@
<script lang="ts">
import { emptyArray } from '@kodadot1/minimark/utils'
import { Attribute } from '@kodadot1/minimark/common'
import { NeoSelect, NeoTable, NeoTableColumn } from '@kodadot1/brick'
import { NeoButton, NeoSelect, NeoTable, NeoTableColumn } from '@kodadot1/brick'
import { Component, Emit, Prop, mixins } from 'nuxt-property-decorator'
import { formatDistanceToNow } from 'date-fns'
Expand All @@ -105,6 +104,7 @@ const components = {
NeoTable,
NeoTableColumn,
NeoSelect,
NeoButton,
}
@Component({ components, filters: { formatDistanceToNow } })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@ const formatPrice = (price) => {
overflow-y: auto;
}
@include touch {
.gallery-item-activity-table {
:deep .o-table__td {
border-bottom: inherit !important;
}
}
}
@include mobile {
.padding-top-mobile {
padding-top: 0 !important;
Expand Down
8 changes: 0 additions & 8 deletions components/items/ItemsGrid/utils/useSearchParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,6 @@ function useSearchByCollections() {
},
},
]
} else if (route.query.collectionId) {
return [
{
collection: {
id_eq: route.query.collectionId,
},
},
]
}
return []
}),
Expand Down
40 changes: 21 additions & 19 deletions components/navbar/ExploreDropdown.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
<template>
<NeoDropdown :triggers="!isMobileDevice ? ['hover'] : []">
<NeoDropdown animation="" :triggers="!isMobileDevice ? ['hover'] : []">
<template #trigger>
<nuxt-link :to="`/${urlPrefix}/explore/collectibles`">
<div class="navbar-item" data-cy="explore">
{{ $t('explore') }}
<svg
v-if="!isMobileDevice"
class="ml-1"
width="14"
height="7"
viewBox="0 0 14 7"
fill="none"
xmlns="http://www.w3.org/2000/svg">
<path
d="M13.0002 1L7.00024 6L1.00025 0.999999"
stroke="currentColor"
stroke-width="1.26984" />
</svg>
</div>
</nuxt-link>
<div>
<nuxt-link :to="`/${urlPrefix}/explore/collectibles`">
<div class="navbar-item" data-cy="explore">
{{ $t('explore') }}
<svg
v-if="!isMobileDevice"
class="ml-1"
width="14"
height="7"
viewBox="0 0 14 7"
fill="none"
xmlns="http://www.w3.org/2000/svg">
<path
d="M13.0002 1L7.00024 6L1.00025 0.999999"
stroke="currentColor"
stroke-width="1.26984" />
</svg>
</div>
</nuxt-link>
</div>
</template>
<NeoDropdownItem aria-role="menuitem" class="is-size-6" custom>
<NavbarExploreOptions />
Expand Down
37 changes: 20 additions & 17 deletions components/navbar/NavbarExploreOptions.vue
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
<template>
<div>
<nuxt-link
:to="`/${urlPrefix}/explore/items`"
class="menu-item mr-2"
@click.native="emit('closeMobileNavbar')">
{{ $t('items') }}
</nuxt-link>
<nuxt-link
:to="`/${urlPrefix}/explore/collectibles`"
class="menu-item mr-2"
@click.native="emit('closeMobileNavbar')">
{{ $t('collections') }}
</nuxt-link>
<span class="menu-item is-disabled">
{{ $t('users') }}
<span class="small-size-text">
{{ $t('soon') }}
<div class="is-flex is-flex-wrap-nowrap">
<nuxt-link
:to="`/${urlPrefix}/explore/items`"
class="menu-item mr-2"
@click.native="emit('closeMobileNavbar')">
{{ $t('items') }}
</nuxt-link>
<nuxt-link
:to="`/${urlPrefix}/explore/collectibles`"
class="menu-item mr-2"
@click.native="emit('closeMobileNavbar')">
{{ $t('collections') }}
</nuxt-link>
<span class="menu-item is-disabled">
{{ $t('users') }}
<span class="small-size-text">
{{ $t('soon') }}
</span>
</span>
</span>
</div>

<hr aria-role="menuitem" class="dropdown-divider my-4" />
<div>
<span
Expand Down
Loading

0 comments on commit 56960c1

Please sign in to comment.