From e7f7436f17b863dd445144e892145f266481ebdf Mon Sep 17 00:00:00 2001 From: "Ng Wing Tat, David" Date: Wed, 28 Jun 2023 18:06:22 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Support=20batch=20collect=20(#1137)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🚧 Add UI for batch collect * 👔 Remove shopping cart entry * 🚸 Move collect all button to the side * 🚸 Prevent collect all while loading * 🚸 Filter WNFT batch collected in portfolio * 💬 Update text * 🎨 FIx possible try-catch issue * 💄 Move insufficient balance label * 🚸 Prevent closing tx dialog in batch purchase * 🐛 Fix batch collect message handling * 💬 Use backpack for shopping cart --------- Co-authored-by: Edmond Yu --- src/assets/icons/local-mall.svg | 3 + src/components/CardV2.vue | 29 +- .../EventModal/Collect/MethodButton.vue | 2 + src/components/EventModal/Collect/index.vue | 96 ++++++- src/components/NFTPortfolio/MainView.vue | 2 + .../NFTPortfolio/SubscriptionForm.vue | 7 +- src/components/ShoppingCart/ListRow.vue | 128 +++++++++ src/components/ShoppingCart/SiteButton.vue | 66 +++++ src/components/SiteHeader.vue | 19 +- src/constant/index.js | 6 + src/locales/en.json | 26 +- src/locales/zh-Hant.json | 26 +- src/mixins/nft.js | 10 +- src/nuxt.config.js | 1 + src/pages/_id/index.vue | 85 +++++- src/pages/shopping-cart.vue | 264 ++++++++++++++++++ src/plugins/nuxt-client-init.client.js | 3 + src/store/index.js | 3 + src/store/modules/nft.js | 72 ++++- src/store/mutation-types.js | 4 + src/util/shopping-cart.js | 21 ++ 21 files changed, 822 insertions(+), 51 deletions(-) create mode 100644 src/assets/icons/local-mall.svg create mode 100644 src/components/ShoppingCart/ListRow.vue create mode 100644 src/components/ShoppingCart/SiteButton.vue create mode 100644 src/pages/shopping-cart.vue create mode 100644 src/plugins/nuxt-client-init.client.js create mode 100644 src/util/shopping-cart.js diff --git a/src/assets/icons/local-mall.svg b/src/assets/icons/local-mall.svg new file mode 100644 index 000000000..e684ac95a --- /dev/null +++ b/src/assets/icons/local-mall.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/CardV2.vue b/src/components/CardV2.vue index 023663129..71f334f6f 100644 --- a/src/components/CardV2.vue +++ b/src/components/CardV2.vue @@ -25,17 +25,30 @@ export default class Card extends Vue { @Prop({ default: false }) readonly isDark!: boolean; + @Prop({ default: false }) + readonly isOutline!: boolean; + get rootClasses() { - return [ - this.isDark - ? 'bg-like-green bg-gradient-to-r from-transparent to-like-cyan-translucent' - : 'bg-white', + const classes = [ 'rounded-[24px]', - { - 'text-like-cyan-pale': this.isDark, - 'px-[24px] py-[32px]': this.hasPadding, - }, + { 'px-[24px] py-[32px]': this.hasPadding }, ]; + if (this.isOutline) { + classes.push('border'); + if (this.isDark) { + classes.push('border-like-cyan-pale'); + } else { + classes.push('border-gray-d8'); + } + } else if (this.isDark) { + classes.push( + 'bg-like-green bg-gradient-to-r from-transparent to-like-cyan-translucent', + 'text-like-cyan-pale' + ); + } else { + classes.push('bg-white'); + } + return classes; } } diff --git a/src/components/EventModal/Collect/MethodButton.vue b/src/components/EventModal/Collect/MethodButton.vue index 2f7fcf344..bd8b50c0d 100644 --- a/src/components/EventModal/Collect/MethodButton.vue +++ b/src/components/EventModal/Collect/MethodButton.vue @@ -7,7 +7,9 @@ @click="handleClick" >