From 0edf4ccd463f08ce8df6b045185b5b3d5168da4a Mon Sep 17 00:00:00 2001 From: Zeck Li <11781254+zeckli@users.noreply.github.com> Date: Tue, 5 Nov 2024 19:47:21 +0800 Subject: [PATCH 1/4] feat(tracker): add the event tracker for clicking collection tab in user profile page --- src/common/utils/analytics.ts | 1 + src/components/Tabs/index.tsx | 7 ++++++- src/views/User/UserTabs/index.tsx | 8 +++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/common/utils/analytics.ts b/src/common/utils/analytics.ts index 40fe0379ef..74c59c2a37 100644 --- a/src/common/utils/analytics.ts +++ b/src/common/utils/analytics.ts @@ -103,6 +103,7 @@ export interface ClickButtonProp { | 'newest' | 'campaign_detail_link' | `campaign_detail_tab_${string}` + | `user_profile_tab_${string}` pageType?: PageType pageComponent?: PageComponent } diff --git a/src/components/Tabs/index.tsx b/src/components/Tabs/index.tsx index c7889e523b..13fc088c21 100644 --- a/src/components/Tabs/index.tsx +++ b/src/components/Tabs/index.tsx @@ -36,7 +36,12 @@ const Tab: React.FC> = ({ if (href) { return ( -
  • +
  • {children} diff --git a/src/views/User/UserTabs/index.tsx b/src/views/User/UserTabs/index.tsx index ff27781ae0..df4bebdba9 100644 --- a/src/views/User/UserTabs/index.tsx +++ b/src/views/User/UserTabs/index.tsx @@ -1,7 +1,7 @@ import { useContext } from 'react' import { FormattedMessage } from 'react-intl' -import { toPath } from '~/common/utils' +import { analytics, toPath } from '~/common/utils' import { Tabs, useRoute, ViewerContext } from '~/components' import { TabsUserFragment } from '~/gql/graphql' @@ -53,6 +53,12 @@ const UserTabs = ({ {...userCollectionsPath} selected={isInPath('USER_COLLECTIONS')} count={collectionCount > 0 ? collectionCount : undefined} + onClick={() => { + analytics.trackEvent('click_button', { + type: `user_profile_tab_collection` as `user_profile_tab_${string}`, + pageType: 'user_profile', + }) + }} > From ce92c6d4dd8f516039fb92b79ff0a8f4c37b405b Mon Sep 17 00:00:00 2001 From: gitwoz <177856586+gitwoz@users.noreply.github.com> Date: Tue, 5 Nov 2024 16:54:29 +0800 Subject: [PATCH 2/4] feat(ipns): show IPNS (RSS) dialog only if user has ENS --- src/common/utils/wallet.ts | 6 +++--- src/views/User/UserProfile/DropdownActions/index.tsx | 10 +++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/common/utils/wallet.ts b/src/common/utils/wallet.ts index 98aa371d45..b25eda65c6 100644 --- a/src/common/utils/wallet.ts +++ b/src/common/utils/wallet.ts @@ -1,11 +1,11 @@ import { Chain, configureChains, createConfig } from 'wagmi' import { - goerli, mainnet, optimism, optimismSepolia, polygon, polygonMumbai, + sepolia, } from 'wagmi/chains' import { InjectedConnector } from 'wagmi/connectors/injected' import { WalletConnectConnector } from 'wagmi/connectors/walletConnect' @@ -20,7 +20,7 @@ const alchemyId = process.env.NEXT_PUBLIC_ALCHEMY_KEY! export const featureSupportedChains = { billboard: isProd ? [optimism] : [optimismSepolia], curation: isProd ? [optimism] : [optimismSepolia], - ens: isProd ? [mainnet] : [goerli], + ens: isProd ? [mainnet] : [sepolia], } export const explorers = { @@ -34,7 +34,7 @@ export const explorers = { const defaultChains: Chain[] = isProd ? [mainnet, optimism] - : [goerli, optimismSepolia] + : [sepolia, optimismSepolia] export const { publicClient, chains } = configureChains(defaultChains, [ alchemyProvider({ apiKey: alchemyId }), diff --git a/src/views/User/UserProfile/DropdownActions/index.tsx b/src/views/User/UserProfile/DropdownActions/index.tsx index ac18a449af..edb2b6d9f2 100644 --- a/src/views/User/UserProfile/DropdownActions/index.tsx +++ b/src/views/User/UserProfile/DropdownActions/index.tsx @@ -4,10 +4,12 @@ import _pickBy from 'lodash/pickBy' import dynamic from 'next/dynamic' import { useContext } from 'react' import { FormattedMessage, useIntl } from 'react-intl' +import { useEnsName } from 'wagmi' import { ReactComponent as IconMore } from '@/public/static/icons/24px/more.svg' import { ReactComponent as IconRss } from '@/public/static/icons/24px/rss.svg' import { ReactComponent as IconShare } from '@/public/static/icons/24px/share.svg' +import { featureSupportedChains } from '~/common/utils' import { Button, Dropdown, @@ -230,11 +232,17 @@ const BaseDropdownActions = ({ const DropdownActions = ({ user, isMe, isInAside }: DropdownActionsProps) => { const viewer = useContext(ViewerContext) + const targetNetwork = featureSupportedChains.ens[0] + const { data: ensName } = useEnsName({ + address: user.info.ethAddress as `0x${string}`, + chainId: targetNetwork.id, + }) const controls = { hasEditProfile: isMe, hasBlockUser: !!viewer.id && !isMe, - hasRssFeed: user?.articles.totalCount > 0 && !!user?.info.ipnsKey, + hasRssFeed: + ensName && user?.articles.totalCount > 0 && !!user?.info.ipnsKey, } const WithShare = withDialog>( From ffff3490af4ff61784cfaf2f19d8fb218a515f94 Mon Sep 17 00:00:00 2001 From: Kechicode <186776112+Kechicode@users.noreply.github.com> Date: Fri, 8 Nov 2024 11:26:22 +0000 Subject: [PATCH 3/4] fix: add i18n command --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 1efe6b2ba7..e3d7695d8f 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ - Install dependencies: `npm i` - Environment variables: `cp .env.local.example .env.local` - Run `npm run gen:type` +- Run `npm run i18n` - Run `npm run dev`, then go to `http://localhost:3000/` ### Build and run production server From 132b3f7926944082c8fb11588327b448142805a2 Mon Sep 17 00:00:00 2001 From: Woz <177856586+gitwoz@users.noreply.github.com> Date: Thu, 14 Nov 2024 10:08:43 +0800 Subject: [PATCH 4/4] chore(release): v5.6.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 47f7c64427..242319ed45 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "matters-web", - "version": "5.6.5", + "version": "5.6.6", "description": "codebase of Matters' website", "author": "Matters ", "engines": {