Skip to content

Commit

Permalink
Merge pull request #4940 from thematters/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
pauljusti authored Nov 15, 2024
2 parents 560c395 + 718d553 commit 6f55cf7
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "matters-web",
"version": "5.6.5",
"version": "5.6.6",
"description": "codebase of Matters' website",
"author": "Matters <[email protected]>",
"engines": {
Expand Down
1 change: 1 addition & 0 deletions src/common/utils/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export interface ClickButtonProp {
| 'newest'
| 'campaign_detail_link'
| `campaign_detail_tab_${string}`
| `user_profile_tab_${string}`
pageType?: PageType
pageComponent?: PageComponent
}
Expand Down
6 changes: 3 additions & 3 deletions src/common/utils/wallet.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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 = {
Expand All @@ -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 }),
Expand Down
7 changes: 6 additions & 1 deletion src/components/Tabs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ const Tab: React.FC<React.PropsWithChildren<TabProps>> = ({

if (href) {
return (
<li role="tab" aria-selected={selected} className={classes}>
<li
role="tab"
aria-selected={selected}
className={classes}
onClick={onClick}
>
<Link href={href || ''} legacyBehavior>
<a>
{children}
Expand Down
10 changes: 9 additions & 1 deletion src/views/User/UserProfile/DropdownActions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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<Omit<ShareDialogProps, 'children'>>(
Expand Down
8 changes: 7 additions & 1 deletion src/views/User/UserTabs/index.tsx
Original file line number Diff line number Diff line change
@@ -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'

Expand Down Expand Up @@ -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',
})
}}
>
<FormattedMessage defaultMessage="Collections" id="ulh3kf" />
</Tabs.Tab>
Expand Down

0 comments on commit 6f55cf7

Please sign in to comment.