11import { memo , useCallback , useMemo } from 'react'
22import { useNavigate } from 'react-router-dom'
33import { makeStyles } from '@masknet/theme'
4- import { useRemoteControlledDialog } from '@masknet/shared'
4+ import { useRemoteControlledDialog } from '@masknet/shared-base-ui '
55import { useAccount } from '@masknet/web3-shared-evm'
66import { PluginMessages , Services } from '../../../API'
77import { PersonaContext } from '../../../pages/Personas/hooks/usePersonaContext'
8- import { DashboardRoutes } from '@masknet/shared-base'
8+ import { DashboardRoutes , EnhanceableSite } from '@masknet/shared-base'
99import { PluginId } from '@masknet/plugin-infra'
1010
1111const useStyles = makeStyles ( ) ( ( theme ) => ( {
@@ -28,9 +28,6 @@ const useStyles = makeStyles()((theme) => ({
2828 } ,
2929} ) )
3030
31- const TWITTER_NETWORK = 'twitter.com'
32- const TWITTER_ADDRESS = 'https://www.twitter.com'
33-
3431export const FeaturePromotions = memo ( ( ) => {
3532 const { classes } = useStyles ( )
3633 const navigate = useNavigate ( )
@@ -45,7 +42,7 @@ export const FeaturePromotions = memo(() => {
4542 const { linkedProfiles } = currentPersona
4643 if ( linkedProfiles . length === 0 ) return false
4744
48- return ! ! linkedProfiles . find ( ( profile ) => profile . identifier . network === TWITTER_NETWORK )
45+ return ! ! linkedProfiles . find ( ( profile ) => profile . identifier . network === EnhanceableSite . Twitter )
4946 } , [ currentPersona ] )
5047
5148 const openTransakDialog = useCallback ( ( ) => {
@@ -61,13 +58,13 @@ export const FeaturePromotions = memo(() => {
6158 return
6259 }
6360 if ( isConnectedTwitter ) {
64- await Services . SocialNetwork . openSNSAndActivatePlugin ( ` ${ TWITTER_ADDRESS } / home` , pluginId )
61+ await Services . SocialNetwork . openSNSAndActivatePlugin ( 'https://twitter.com/ home' , pluginId )
6562 return
6663 }
67- connectPersona ( currentPersona . identifier , TWITTER_NETWORK )
64+ connectPersona ( currentPersona . identifier , EnhanceableSite . Twitter )
6865 }
6966
70- const openMaskNetwork = ( ) => window . open ( ` ${ TWITTER_ADDRESS } / realMaskNetwork` )
67+ const openMaskNetwork = ( ) => window . open ( 'https://twitter.com/ realMaskNetwork' )
7168
7269 return (
7370 < div className = { classes . container } >
0 commit comments