-
-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4511 from kodadot/feat-new-nft-card
#4496 gallery card changes
- Loading branch information
Showing
11 changed files
with
201 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<template> | ||
<NeoNftCard :nft="nft" :prefix="urlPrefix" :show-price="showPrice" /> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { NeoNftCard } from '@kodadot1/brick' | ||
import type { NFT } from '@/components/rmrk/service/scheme' | ||
const { urlPrefix } = usePrefix() | ||
const props = defineProps<{ | ||
nft: NFT | ||
}>() | ||
const showPrice = computed((): boolean => { | ||
return Number(props.nft?.price) > 0 | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
@import '../../scss/variable.scss'; | ||
|
||
.nft-card { | ||
&:hover { | ||
box-shadow: $primary-shadow; | ||
} | ||
} | ||
.nft-media { | ||
border: 1px solid $black; | ||
border-bottom: none !important; | ||
box-shadow: none; | ||
} | ||
|
||
.nft-media-info { | ||
border: 1px solid $black; | ||
padding: 13px; | ||
min-height: 102px; | ||
} | ||
|
||
.nft-info-collection-name { | ||
color: $k-grey; | ||
&:hover { | ||
color: $black; | ||
} | ||
} | ||
|
||
.chain-name { | ||
text-transform: uppercase; | ||
color: $k-grey; | ||
} | ||
|
||
.dark-mode { | ||
.nft-card { | ||
&:hover { | ||
box-shadow: $primary-shadow-dark; | ||
} | ||
} | ||
|
||
.nft-media { | ||
border: 1px solid $white; | ||
} | ||
|
||
.nft-info-collection-name { | ||
&:hover { | ||
color: $white; | ||
} | ||
} | ||
|
||
.nft-media-info { | ||
border: 1px solid $white; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<template> | ||
<Story title="NeoNftCard"> | ||
<Variant title="Nft Card"> | ||
<NeoNftCard :nft="nft" prefix="rmrk" show-price /> | ||
</Variant> | ||
</Story> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import NeoNftCard from './NeoNftCard.vue' | ||
const nft = { | ||
id: '1825819407-173', | ||
metadata: | ||
'ipfs://ipfs/bafkreig6e5x4nrif2jis4lbqmozx3el5nejskhbkbma7wmoyf2mrmehk2u', | ||
name: 'KoDragon#166', | ||
price: '20', | ||
sn: '173', | ||
image: | ||
'https://kodadot.mypinata.cloud/ipfs/bafybeigdh3ecetqmzplrjrovs5po23vwpikh2vgtfjai4vky5qzitjzaq4', | ||
collection: { | ||
id: '1825819407', | ||
name: 'KoDragons', | ||
}, | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<template> | ||
<div class="nft-card"> | ||
<nuxt-link :to="`/${prefix}/gallery/${nft.id}`"> | ||
<MediaItem | ||
:key="nft.image" | ||
class="nft-media" | ||
:src="nft.image" | ||
:animation-src="nft.animationUrl" | ||
:mime-type="nft.mimeType" | ||
:title="nft?.name" /> | ||
</nuxt-link> | ||
<div | ||
class="nft-media-info is-flex is-flex-direction-column is-justify-content-space-between"> | ||
<div class="is-flex is-flex-direction-column"> | ||
<span class="is-ellipsis has-text-weight-bold">{{ nft.name }}</span> | ||
<nuxt-link | ||
v-if="nft.collection.name && nft.collection.id" | ||
:title="nft.collectionName || nft.collection.name" | ||
:to="`/${prefix}/collection/${nft.collection.id}`" | ||
class="is-size-7 nft-info-collection-name"> | ||
{{ nft.collection.name }} | ||
</nuxt-link> | ||
</div> | ||
<div | ||
class="is-flex is-align-items-center is-justify-content-space-between mt-2"> | ||
<CommonTokenMoney v-if="showPrice" :value="nft.price" /> | ||
<span class="chain-name">{{ prefix }}</span> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
<script lang="ts" setup> | ||
import MediaItem from '../MediaItem/MediaItem.vue' | ||
import CommonTokenMoney from '@/components/shared/CommonTokenMoney.vue' | ||
import type { NFT } from '@/components/rmrk/service/scheme' | ||
defineProps<{ | ||
nft: NFT | ||
prefix: string | ||
showPrice: boolean | ||
}>() | ||
</script> | ||
<style lang="scss" scoped> | ||
@import './NeoNftCard.scss'; | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.