Skip to content

Commit

Permalink
Disable the "Delete Certificate" button when you are not logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandr-slobodian committed Sep 19, 2024
1 parent 4be1db6 commit e164734
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export function App() {
onViewDetails={handleCertificateViewerDialogOpen}
loading={!fetching.certificates || fetching.certificates === "pending"}
highlightedText={searchedText}
isLoggedIn={isCurrentProviderLogedin}
/>
<FetchingStatusOwerlay
fetching={fetching}
Expand Down
3 changes: 3 additions & 0 deletions src/components/certificates-list/CertificatesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ interface CertificatesListProps {
className?: ComponentProps<"table">["className"];
highlightedText?: string;
loading?: boolean;
isLoggedIn: boolean;
}

export const CertificatesList: React.FunctionComponent<
Expand All @@ -69,6 +70,7 @@ export const CertificatesList: React.FunctionComponent<
currentSortDir,
highlightedText,
loading,
isLoggedIn,
onSort,
onViewDetails,
onDelete,
Expand Down Expand Up @@ -252,6 +254,7 @@ export const CertificatesList: React.FunctionComponent<
}
size="small"
className={styles.action_icon_button}
disabled={!isLoggedIn}
>
<DeleteIcon />
</IconButton>
Expand Down
2 changes: 1 addition & 1 deletion src/components/certificates-list/styles/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
margin-right: var(--pv-size-base-2);
}

.action_icon_button {
.action_icon_button:not(:disabled) {
color: var(--pv-color-gray-10);
}
}
Expand Down

0 comments on commit e164734

Please sign in to comment.