Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed the delete facility button to be hidden and not diabled #6677

Closed
wants to merge 13 commits into from
Closed
25 changes: 15 additions & 10 deletions src/Components/Facility/FacilityHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -594,16 +594,21 @@ export const FacilityHome = (props: any) => {
>
View Users
</DropdownItem>
<DropdownItem
id="delete-facility"
variant="danger"
onClick={() => setOpenDeleteDialog(true)}
className="flex items-center gap-3"
icon={<CareIcon className="care-l-trash-alt text-lg" />}
authorizeFor={AuthorizeFor(["DistrictAdmin", "StateAdmin"])}
>
Delete Facility
</DropdownItem>
{authUser.user_type == "DistrictAdmin" ||
authUser.user_type == "StateAdmin" ? (
<DropdownItem
id="delete-facility"
variant="danger"
onClick={() => setOpenDeleteDialog(true)}
className="flex items-center gap-3"
icon={<CareIcon className="care-l-trash-alt text-lg" />}
authorizeFor={AuthorizeFor(["DistrictAdmin", "StateAdmin"])}
>
Delete Facility
</DropdownItem>
) : (
<></>
)}
rithviknishad marked this conversation as resolved.
Show resolved Hide resolved
</DropdownMenu>
</div>
<div className="flex flex-col justify-end">
Expand Down