Skip to content

Commit

Permalink
🔀 Merge develop into deploy/rinkeby
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Feb 17, 2025
2 parents dc4f71a + e4d1fc2 commit 2f5b33b
Show file tree
Hide file tree
Showing 13 changed files with 93 additions and 14 deletions.
12 changes: 10 additions & 2 deletions src/components/NFTBook/ItemCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
:to="
localeLocation({
name: 'store',
query: { q: iscnWorkAuthorName },
query: { q: authorQuery || iscnWorkAuthorName },
})
"
>
Expand Down Expand Up @@ -251,7 +251,7 @@
/>
</NuxtLink>
</li>
<client-only>
<client-only v-if="!isOwnerHidden">
<li>
<NuxtLink
class="flex items-center text-like-green group"
Expand Down Expand Up @@ -431,6 +431,14 @@ export default {
type: String,
default: '',
},
isOwnerHidden: {
type: Boolean,
default: false,
},
authorQuery: {
type: String,
default: '',
},
},
data() {
return {
Expand Down
8 changes: 8 additions & 0 deletions src/components/NFTPage/Recommendation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ export default {
type: String,
default: '',
},
overrideClassIds: {
type: Array,
default: () => [],
},
},
computed: {
...mapGetters(['walletHasLoggedIn', 'walletFollowees']),
Expand Down Expand Up @@ -171,6 +175,10 @@ export default {
return this.defaultFeaturedBooks;
},
recommendedList() {
if (this.overrideClassIds.length) {
return this.overrideClassIds.map(classId => ({ classId }));
}
if (this.shouldShowDefaultRecommendation) {
return this.defaultFeaturedBooks;
}
Expand Down
31 changes: 31 additions & 0 deletions src/constant/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,10 @@ export const RECOMMENDATION_GROUPS = IS_TESTNET
'likenft1h2ze9wd80gqkwnt54ueqkruhe2kshed7pjhuwrqjytg5jcy6639sqqmdcv',
'likenft1qq06n42guzvt087wxunaajvz3alx6wadq6mfz0yz57gffwsrgrasl2m59x',
],
[
'likenft1vwm4ze65h5vv84uahwd3x52xp8t9q5xqex3d58mvgeurrm0dk0yqcwd6d8',
'likenft1emvvd04ynymxn7d62mmmqxr7xrye92wqxxgh394r2jnznnl0uneqapg60l',
],
]
: [
// FengHouShanLin
Expand Down Expand Up @@ -358,6 +362,11 @@ export const RECOMMENDATION_GROUPS = IS_TESTNET
'likenft15entdx6z5l2r7wqc93fz32g53ve6lfk4tgqqzl8ereg7tvs3t9nq82n5m3',
'likenft19ul7dkwj2p8fs3m6t4gy77p7mlgnyy3ehcmran2f4us8ctn6yw5sk7fx2z',
],
[
'likenft1d7m9zdw3zmd6jfvu0l6zgr3f4pz3me49ahzgl20wujwus6jtc2zq7ekm6u',
'likenft17zq3r5t2qwfatle04sz680vl3ka0l8wfeu4n5jv26mnvawnfqs4qd773ny',
'likenft154xhw0qyds5pgvsyc7379lnkyvwqkvv2zvmmh2gn5qrewljeqwys2sju6x',
],
];

export const CROSS_SELL_WHITE_LIST = IS_TESTNET
Expand Down Expand Up @@ -396,6 +405,11 @@ export const CROSS_SELL_WHITE_LIST = IS_TESTNET
'likenft154xhw0qyds5pgvsyc7379lnkyvwqkvv2zvmmh2gn5qrewljeqwys2sju6x',
probability: 1,
},
{
id:
'likenft1d7m9zdw3zmd6jfvu0l6zgr3f4pz3me49ahzgl20wujwus6jtc2zq7ekm6u',
probability: 1,
},
];

export const AFFILIATION_CHANNEL_LEGACY_STRINGS = {
Expand Down Expand Up @@ -466,6 +480,23 @@ export const NFT_BOOK_WITH_EVENT_BANNER_SET = [
},
];

export const NFT_BOOK_PRODUCT_PAGE_OVERRIDE = IS_TESTNET
? {}
: {
likenft1d7m9zdw3zmd6jfvu0l6zgr3f4pz3me49ahzgl20wujwus6jtc2zq7ekm6u: {
authorQuery: '邵家臻',
isOwnerHidden: true,
recommendedClassIds: IS_TESTNET
? [
'likenft1emvvd04ynymxn7d62mmmqxr7xrye92wqxxgh394r2jnznnl0uneqapg60l',
]
: [
'likenft17zq3r5t2qwfatle04sz680vl3ka0l8wfeu4n5jv26mnvawnfqs4qd773ny',
'likenft154xhw0qyds5pgvsyc7379lnkyvwqkvv2zvmmh2gn5qrewljeqwys2sju6x',
],
},
};

export const SIGN_AUTHORIZATION_PERMISSIONS = [
'profile',
'read:nftbook',
Expand Down
13 changes: 13 additions & 0 deletions src/mixins/nft.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
USD_TO_HKD_RATIO,
NFT_BOOK_WITH_SIGN_IMAGE_SET,
NFT_BOOK_WITH_EVENT_BANNER_SET,
NFT_BOOK_PRODUCT_PAGE_OVERRIDE,
} from '~/constant';

import {
Expand Down Expand Up @@ -727,6 +728,18 @@ export default {
nftShouldShowEventBanner() {
return !!this.nftEventBanner && !this.nftShouldHideEventBanner;
},
nftPageOverride() {
return NFT_BOOK_PRODUCT_PAGE_OVERRIDE[this.classId];
},
nftAuthorQueryOverride() {
return this.nftPageOverride?.authorQuery || '';
},
nftIsOwnerHidden() {
return this.nftPageOverride?.isOwnerHidden || false;
},
nftRecommendedClassIdsOverride() {
return this.nftPageOverride?.recommendedClassIds || [];
},
},
watch: {
getAddress(newAddress) {
Expand Down
7 changes: 7 additions & 0 deletions src/mixins/utm.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export default {
this.linkMedium
);
},
googleOrganicId() {
return this.$route.query.srsltid;
},
gadClickId() {
return this.$route.query.gclid;
},
Expand All @@ -37,6 +40,10 @@ export default {
},
mounted() {
this.documentReferrer = document.referrer;
if (this.googleOrganicId) {
if (!this.utmSource) this.utmSource = 'google';
if (!this.utmMedium) this.utmMedium = 'organic';
}
this.restoreUTMFromSessionStorage();
this.storeUTMToSessionStorage();
this.getFbClickIdFromCookie();
Expand Down
2 changes: 1 addition & 1 deletion src/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ const nuxtConfig = {
'@context': 'http://www.schema.org',
'@type': 'OnlineStore',
name: 'Liker Land Bookstore',
alternateName: ['Liker Land 電子書店', 'Liker.Land'],
alternateName: ['Liker Land 電子書店', 'Liker.Land', 'Liker Land'],
description:
'Liker Land is a Web3 bookstore with a decentralized publishing stack that assists authors in registering and storing their articles, ebooks on the blockchain and decentralized networks',
url: 'https://liker.land',
Expand Down
3 changes: 2 additions & 1 deletion src/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ export default {
const script = [
{
hid: 'schema',
hid: 'schema-faq',
innerHTML: JSON.stringify({
'@context': 'https://schema.org',
'@type': 'FAQPage',
Expand All @@ -971,6 +971,7 @@ export default {
})),
}),
type: 'application/ld+json',
body: true,
},
{
hid: 'elfsight',
Expand Down
7 changes: 5 additions & 2 deletions src/pages/nft/claim/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@
{{ iscnWorkPublisher }}
</p>
</div>
<div v-if="creatorDisplayName" class="flex flex-col w-full">
<div
v-if="creatorDisplayName && !nftIsOwnerHidden"
class="flex flex-col w-full"
>
<Label
preset="h6"
:text="
Expand Down Expand Up @@ -1041,7 +1044,7 @@ export default {
logTrackerEvent(
this,
'NFT',
this.isEnableCrossSell
this.isCrossSellEnabled
? 'nft_claim_cross_sell_enabled'
: 'nft_claim_cross_sell_disabled',
this.classId,
Expand Down
9 changes: 6 additions & 3 deletions src/pages/nft/class/_classId/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
v-if="nftShouldShowEventBanner"
:class="[
'phone:relative fixed',
'z-[100]',
'sm:z-[60]',
'sm:left-[30px]',
'sm:bottom-[30px]',
Expand Down Expand Up @@ -56,7 +56,7 @@
/>
<source :srcset="nftEventBanner?.imgSrcForMobile" />
<img
src="~/assets/images/misc/bottleshiu/20250215-bookclub-mobile.png"
:src="nftEventBanner?.imgSrcForMobile"
:alt="nftEventBanner?.imgAlt"
/>
</picture>
Expand Down Expand Up @@ -94,6 +94,8 @@
<NFTBookItemCard
:class-id="classId"
preset="details"
:author-query="nftAuthorQueryOverride"
:is-owner-hidden="nftIsOwnerHidden"
@click-avatar="handleNFTCardClickAvatar"
@clickTooltip="handleNFTCardClickTooltip"
@expand="handleBookInfoExpand"
Expand Down Expand Up @@ -302,6 +304,7 @@
<!-- recommend -->
<NFTPageRecommendation
:class-id="classId"
:override-class-ids="nftRecommendedClassIdsOverride"
@header-avatar-click="handleRecommendationHeaderAvatarClick"
@follow-button-click="handleFollowButtonClick"
@item-click="handleRecommendedItemClick"
Expand Down Expand Up @@ -1263,7 +1266,7 @@ export default {
logTrackerEvent(
this,
'NFT',
this.isEnableCrossSell
this.isCrossSellEnabled
? 'nft_class_details_cross_sell_enabled'
: 'nft_class_details_cross_sell_disabled',
this.classId,
Expand Down
7 changes: 6 additions & 1 deletion src/pages/reader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
<Component
:is="isLoginRequired ? 'AuthRequiredView' : 'div'"
v-else
class="w-full h-full"
:class="[
'w-full h-full',
{
'flex items-center justify-center': !isLoginRequired,
},
]"
:login-label="$t('dashboard_login_in')"
:login-button-label="$t('header_button_connect_to_wallet')"
>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/store/articles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export default {
],
script: [
{
hid: 'schema',
hid: 'schema-store',
innerHTML: JSON.stringify(schema),
type: 'application/ld+json',
body: true,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/store/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ export default {
],
script: [
{
hid: 'schema',
hid: 'schema-store',
innerHTML: JSON.stringify(schema),
type: 'application/ld+json',
body: true,
Expand Down
4 changes: 2 additions & 2 deletions src/store/modules/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ const actions = {
if (getters.getAddress) {
// Re-login if the wallet address is different from session
const res = await dispatch('signLogin');
return { isNew: res.isNew };
return { isNew: res?.isNew };
}
} catch (err) {
const msg = (err.response && err.response.data) || err;
Expand Down Expand Up @@ -874,7 +874,7 @@ const actions = {
},
async signLogin({ state, commit, dispatch, getters }) {
// Do not trigger login if the window is not focused
if (document.hidden) return null;
if (state.methodType !== 'liker-id' && document.hidden) return null;
if (!state.signer) {
await dispatch('initIfNecessary');
}
Expand Down

0 comments on commit 2f5b33b

Please sign in to comment.