Explorar el Código

feat: adjust profile item menu

GyDi hace 3 años
padre
commit
f2c04621a5
Se han modificado 1 ficheros con 9 adiciones y 3 borrados
  1. 9 3
      src/components/profile-item.tsx

+ 9 - 3
src/components/profile-item.tsx

@@ -238,9 +238,15 @@ const ProfileItem: React.FC<Props> = (props) => {
         anchorReference="anchorPosition"
       >
         <MenuItem onClick={onForceSelect}>Select</MenuItem>
-        <MenuItem onClick={onView}>View</MenuItem>
-        <MenuItem onClick={onUpdateWrapper(false)}>Update</MenuItem>
-        <MenuItem onClick={onUpdateWrapper(true)}>Update(Proxy)</MenuItem>
+        {isUrlMode ? (
+          <>
+            <MenuItem onClick={onView}>View</MenuItem>
+            <MenuItem onClick={onUpdateWrapper(false)}>Update</MenuItem>
+            <MenuItem onClick={onUpdateWrapper(true)}>Update(Proxy)</MenuItem>
+          </>
+        ) : (
+          <MenuItem onClick={onView}>Edit</MenuItem>
+        )}
         <MenuItem onClick={onDelete}>Delete</MenuItem>
       </Menu>
     </>