Skip to content

Commit

Permalink
fix: remove delete and share button on AppDetail
Browse files Browse the repository at this point in the history
  • Loading branch information
mosoriob committed May 29, 2024
1 parent f1fb6c2 commit c07ae6a
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions src/tapis-app/Apps/_components/Toolbar/Toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ const Toolbar: React.FC = () => {
const [modal, setModal] = useState<string | undefined>(undefined);
const { selectedApps } = useAppsSelect();
const { pathname } = useLocation();
console.log('pathname', pathname);
const [_, __, appId, appVersion] = pathname.split('/');
const { claims } = useTapisConfig();
const isCurrentUser = (username: string) =>
Expand All @@ -74,19 +73,23 @@ const Toolbar: React.FC = () => {
aria-label="Add"
/>

<ToolbarButton
text="Delete"
icon="trash"
disabled={selectedApps.length === 0 || !hasPermissions}
onClick={() => setModal('delete')}
aria-label="Delete"
/>
<ToolbarButton
text="Share"
icon="globe"
disabled={selectedApps.length === 0 || !hasPermissions}
onClick={() => setModal('share')}
/>
{!appId && !appVersion ? (
<>
<ToolbarButton
text="Delete"
icon="trash"
disabled={selectedApps.length === 0 || !hasPermissions}
onClick={() => setModal('delete')}
aria-label="Delete"
/>
<ToolbarButton
text="Share"
icon="globe"
disabled={selectedApps.length === 0 || !hasPermissions}
onClick={() => setModal('share')}
/>
</>
) : null}
{modal === 'delete' && <DeleteModal toggle={toggle} />}
{modal === 'upload' && <UploadModal toggle={toggle} />}
{modal === 'share' && <ShareModal toggle={toggle} />}
Expand Down

0 comments on commit c07ae6a

Please sign in to comment.