File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
packages/plugins/Web3Profile/src/SiteAdaptor/components Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,10 @@ const useStyles = makeStyles()((theme) => ({
106106 padding : theme . spacing ( 1.5 ) ,
107107 borderRadius : 8 ,
108108 } ,
109+ disabled : {
110+ opacity : 0.5 ,
111+ cursor : 'not-allowed' ,
112+ } ,
109113 listItemText : {
110114 margin : 0 ,
111115 } ,
@@ -130,7 +134,7 @@ export const ProfilePopup = memo<ProfilePopupProps>(function ProfilePopup({
130134 onChange,
131135 walletName,
132136} ) {
133- const { classes } = useStyles ( )
137+ const { classes, cx } = useStyles ( )
134138 const Utils = useWeb3Utils ( )
135139
136140 const { account : walletAddress } = useChainContext ( )
@@ -161,12 +165,16 @@ export const ProfilePopup = memo<ProfilePopupProps>(function ProfilePopup({
161165 const name = account . metadata ?. name || account . username ?. localName
162166 const ownerAddress : EvmAddress = account . username ?. ownedBy
163167 const accountId = account . username ?. id
168+ const disabled =
169+ ( currentAccountId && currentAccountId === accountId ) ||
170+ available . __typename !== 'AccountManaged'
164171 return (
165172 < ListItemButton
166- className = { classes . item }
173+ className = { cx ( classes . item , { [ classes . disabled ] : disabled } ) }
167174 key = { accountId }
175+ disabled = { disabled }
168176 onClick = { ( ) => {
169- if ( currentAccountId && currentAccountId === accountId ) return
177+ if ( disabled ) return
170178 onChange ( account )
171179 } } >
172180 < ListItemIcon >
You can’t perform that action at this time.
0 commit comments