Skip to content

Commit

Permalink
hide all buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Pranshu1902 committed May 8, 2024
1 parent 8eddf83 commit d498353
Showing 1 changed file with 28 additions and 44 deletions.
72 changes: 28 additions & 44 deletions src/Components/Users/ManageUsers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -822,16 +822,14 @@ export function UserFacilities(props: { user: any }) {
>
<div className="flex items-center justify-between">
<span>{facility.name}</span>
<div className="flex items-center gap-2">
<button
className="tooltip text-lg hover:text-primary-500"
id="home-facility-icon"
onClick={() => {
if (
["DistrictAdmin", "StateAdmin"].includes(
authUser.user_type,
)
) {
{["DistrictAdmin", "StateAdmin"].includes(
authUser.user_type,
) && (
<div className="flex items-center gap-2">
<button
className="tooltip text-lg hover:text-primary-500"
id="home-facility-icon"
onClick={() => {
if (user?.home_facility_object) {
// has previous home facility
setReplaceHomeFacility({
Expand All @@ -845,46 +843,32 @@ export function UserFacilities(props: { user: any }) {
// no previous home facility
updateHomeFacility(username, facility);
}
} else {
Notification.Error({
msg: "You don't have permission to perform this action. Please contact the admin",
});
}
}}
>
<CareIcon icon="l-estate" />
<span className="tooltip-text tooltip-left">
Set as home facility
</span>
</button>
<button
id="unlink-facility-button"
className="tooltip text-lg text-red-600"
onClick={() => {
if (
["DistrictAdmin", "StateAdmin"].includes(
authUser.user_type,
)
) {
}}
>
<CareIcon icon="l-estate" />
<span className="tooltip-text tooltip-left">
Set as home facility
</span>
</button>
<button
id="unlink-facility-button"
className="tooltip text-lg text-red-600"
onClick={() => {
setUnlinkFacilityData({
show: true,
facility: facility,
userName: username,
isHomeFacility: false,
});
} else {
Notification.Error({
msg: "You don't have permission to perform this action. Please contact the admin",
});
}
}}
>
<CareIcon icon="l-link-broken" />
<span className="tooltip-text tooltip-left">
Unlink Facility
</span>
</button>
</div>
}}
>
<CareIcon icon="l-link-broken" />
<span className="tooltip-text tooltip-left">
Unlink Facility
</span>
</button>
</div>
)}
</div>
</div>
);
Expand Down

0 comments on commit d498353

Please sign in to comment.