Skip to content

Commit

Permalink
chore: replace lens profile link (#11557)
Browse files Browse the repository at this point in the history
* fix: replace lens profile link

* chore: name

* fix: remove edit profile
  • Loading branch information
nuanyang233 committed Apr 24, 2024
1 parent d07c7eb commit 8fd1414
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { first } from 'lodash-es'
import { useCallback, useMemo, useState, type MouseEvent } from 'react'
import { useAsyncRetry } from 'react-use'
import { Web3ProfileTrans, useWeb3ProfileTrans } from '../../../locales/i18n_generated.js'
import { getLensterLink, getProfileAvatar } from '../../../utils.js'
import { getFireflyLensProfileLink, getProfileAvatar } from '../../../utils.js'
import { useConfettiExplosion } from '../../hooks/ConfettiExplosion/index.js'
import { useFollow } from '../../hooks/Lens/useFollow.js'
import { useUnfollow } from '../../hooks/Lens/useUnfollow.js'
Expand Down Expand Up @@ -294,7 +294,6 @@ export function FollowLensDialog({ handle, onClose }: Props) {
}, [isFollowing, isHovering, profile])

const tips = useMemo(() => {
if (isSelf && profile) return t.edit_profile_tips({ profile: profile.handle.localName })
if (wallet?.owner || pluginID !== NetworkPluginID.PLUGIN_EVM || providerType === ProviderType.Fortmatic)
return t.follow_wallet_tips()
else if (profile?.followModule?.type === FollowModuleType.ProfileFollowModule && !defaultProfile)
Expand Down Expand Up @@ -358,12 +357,12 @@ export function FollowLensDialog({ handle, onClose }: Props) {
<Button
variant="roundedContained"
className={classes.followAction}
href={profile?.handle ? getLensterLink(profile.handle.localName) : '#'}
href={profile?.handle ? getFireflyLensProfileLink(profile.handle.localName) : '#'}
target="_blank"
rel="noopener noreferrer"
endIcon={<Icons.LinkOut size={18} />}
sx={{ cursor: 'pointer' }}>
{t.edit_profile_in_lenster()}
{t.view_profile_in_firefly()}
</Button>
: <>
<EthereumERC20TokenApprovedBoundary
Expand Down Expand Up @@ -410,12 +409,14 @@ export function FollowLensDialog({ handle, onClose }: Props) {
<Button
className={classes.linkButton}
variant="roundedOutlined"
href={profile?.handle ? getLensterLink(profile.handle.localName) : '#'}
href={
profile?.handle ? getFireflyLensProfileLink(profile.handle.localName) : '#'
}
target="_blank"
rel="noopener noreferrer"
endIcon={<Icons.LinkOut size={18} />}
sx={{ cursor: 'pointer' }}>
{t.hey()}
{t.firefly()}
</Button>
</>
}
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/Web3Profile/src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"NFTs": "NFTs",
"web3_profile": "Web3 Profile",
"EVM_wallet": "EVM Wallet",
"edit_profile_in_lenster": "Edit your profile in lenster",
"edit_profile_tips": "{{- profile}} is owned by the current connected wallet. Please go to hey.xyz to edit profile.",
"view_profile_in_firefly": "View your profile in firefly",
"Solana_wallet": "Solana Wallet",
"Flow_wallet": "Flow Wallet",
"network_error": "Network error, try again",
Expand Down Expand Up @@ -54,6 +53,7 @@
"lens": "Lens",
"lenster": "Lenster",
"hey": "Hey",
"firefly": "Firefly",
"unlisted": "Unlisted",
"add_wallet": "Add Wallet",
"add_wallet_to_connected": "No connected wallet. Please add wallet.",
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/Web3Profile/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { LensBaseAPI } from '@masknet/web3-providers/types'
import urlcat from 'urlcat'

export function getLensterLink(handle: string) {
return urlcat('https://hey.xyz/u/:handle', { handle })
export function getFireflyLensProfileLink(handle: string) {
return urlcat('https://firefly.mask.social/profile/:handle?source=lens', { handle })
}

export function getProfileAvatar(profile: LensBaseAPI.Profile | undefined) {
Expand Down

0 comments on commit 8fd1414

Please sign in to comment.