Skip to content

Commit

Permalink
kodadot#1585 Hiding from collection views
Browse files Browse the repository at this point in the history
  • Loading branch information
prachi00 committed Dec 28, 2021
1 parent f78b211 commit 62d84a6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
6 changes: 3 additions & 3 deletions components/rmrk/Gallery/Gallery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}}</span>
</span>
<BasicImage :src="nft.image" :alt="nft.name" customClass="gallery__image-wrapper" />
<span v-if="nft.price > 0 && !hidePriceGalleryValue" class="card-image__price">
<span v-if="nft.price > 0 && !hidePriceValue" class="card-image__price">
<Money :value="nft.price" inline />
</span>
</div>
Expand Down Expand Up @@ -174,8 +174,8 @@ export default class Gallery extends mixins(PrefixMixin) {
}
get hidePriceGalleryValue(): boolean {
return this.$store.getters['preferences/getHidePriceGalleryValue']
get hidePriceValue(): boolean {
return this.$store.getters['preferences/getHidePriceValue']
}
public async created() {
Expand Down
6 changes: 5 additions & 1 deletion components/rmrk/Gallery/GalleryCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
custom-class="gallery__image-wrapper"
/>
<span
v-if="price > 0"
v-if="price > 0 && !hidePriceValue"
class="card-image__price"
>
<Money
Expand Down Expand Up @@ -135,6 +135,10 @@ export default class GalleryCard extends mixins(AuthMixin) {
}
}
get hidePriceValue(): boolean {
return this.$store.getters['preferences/getHidePriceValue']
}
get nftName(): string {
return this.name || this.title
}
Expand Down
15 changes: 9 additions & 6 deletions components/settings/Interface.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@
{{ $t('Fold description in collection view on default') }}
</b-checkbox>
</b-field>
<b-field >
<b-checkbox v-model="hidePriceGalleryValue" :disabled="!enabledAdvancedUI">
{{ $t('Hide price in gallery view by default') }}
<b-field>
<b-checkbox v-model="replaceBuyNowWithYolo" :disabled="!enabledAdvancedUI">
{{ $t('Replace buy now with YOLO') }}
</b-checkbox>
</b-field>
<b-field>
<b-checkbox v-model="hidePriceValue" :disabled="!enabledAdvancedUI">
{{ $t('Hide price in gallery and collection view by default') }}
</b-checkbox>
</b-field>
<div class="layout-wrapper">
<div class="label">
{{ $t('Layout Options') }}
Expand Down Expand Up @@ -112,12 +115,12 @@ export default class Interface extends Vue {
this.$store.dispatch('preferences/setCompactCollection', value)
}
get hidePriceGalleryValue(): boolean {
get hidePriceValue(): boolean {
return this.$store.state.preferences.hidePriceGallery
}
set hidePriceGalleryValue(value: boolean) {
this.$store.dispatch('preferences/setHidePriceGalleryValue', value)
set hidePriceValue(value: boolean) {
this.$store.dispatch('preferences/setHidePriceValue', value)
}
get replaceBuyNowWithYolo(): boolean {
Expand Down
8 changes: 4 additions & 4 deletions store/preferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const getters: GetterTree<PreferencesState, PreferencesState> = {
getLayoutClass: ({ layoutClass }) => layoutClass,
getTheatreView: ({ theatreView }) => theatreView,
getCompactCollection: ({ compactCollection }) => compactCollection,
getHidePriceGalleryValue: ({ hidePriceGallery }) => hidePriceGallery,
getHidePriceValue: ({ hidePriceGallery }) => hidePriceGallery,
getGalleryItemsPerPage: ({ galleryItemsPerPage }) => galleryItemsPerPage,
getCollectionsPerPage: ({ collectionsPerPage }) => collectionsPerPage,
getReplaceBuyNowWithYolo: ({ replaceBuyNowWithYolo }) => replaceBuyNowWithYolo,
Expand Down Expand Up @@ -60,7 +60,7 @@ export const mutations: MutationTree<PreferencesState> = {
SET_COMPACT_COLLECTION(state: PreferencesState, data) {
state.compactCollection = data
},
SET_HIDE_PRICE_GALLERY(state: PreferencesState, data) {
SET_HIDE_PRICE(state: PreferencesState, data) {
state.hidePriceGallery = data
},
REPLACE_BUYNOW_WITH_YOLO(state: PreferencesState, data) {
Expand Down Expand Up @@ -90,8 +90,8 @@ export const actions: ActionTree<PreferencesState, PreferencesState> = {
setCompactCollection({ commit }: { commit: Commit }, data) {
commit('SET_COMPACT_COLLECTION', data)
},
setHidePriceGalleryValue({ commit }: { commit: Commit }, data) {
commit('SET_HIDE_PRICE_GALLERY', data)
setHidePriceValue({ commit }: { commit: Commit }, data) {
commit('SET_HIDE_PRICE', data)
},
setGalleryItemsPerPage({ commit }: { commit: Commit }, data) {
commit('SET_GALLERY_ITEMS_PER_PAGE', data)
Expand Down

0 comments on commit 62d84a6

Please sign in to comment.