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

Refactor user delete button in FacilityUsers and ManageUsers components #7027

Merged
merged 1 commit into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/Components/Facility/FacilityUsers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,10 @@ export default function FacilityUsers(props: any) {
</span>
</div>
</div>
<div className="mt-2 text-2xl font-bold capitalize">
<div
id="name"
className="mt-2 flex gap-3 text-2xl font-bold capitalize"
>
{`${user.first_name} ${user.last_name}`}

{user.last_login && isUserOnline(user) ? (
Expand All @@ -306,13 +309,12 @@ export default function FacilityUsers(props: any) {
></i>
) : null}
{showUserDelete(authUser, user) && (
<button
type="button"
className="focus:ring-blue m-3 w-20 self-end rounded-md border border-red-500 bg-white px-3 py-2 text-center text-sm font-medium leading-4 text-red-700 transition duration-150 ease-in-out hover:text-red-500 hover:shadow focus:border-red-300 focus:outline-none active:bg-gray-50 active:text-red-800"
<div
className="w-8 cursor-pointer rounded-lg bg-red-50 text-xl text-red-600 hover:bg-red-50 hover:text-red-700"
onClick={() => handleDelete(user)}
>
Delete
</button>
<CareIcon icon="l-trash" className="ml-[5px]" />
</div>
)}
</div>

Expand Down
16 changes: 8 additions & 8 deletions src/Components/Users/ManageUsers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,10 @@ export default function ManageUsers() {
)}
</div>
</div>
<div id="name" className="mt-2 text-2xl font-bold capitalize">
<div
id="name"
className="mt-2 flex gap-3 text-2xl font-bold capitalize"
>
{`${user.first_name} ${user.last_name}`}

{user.last_login && cur_online ? (
Expand All @@ -228,15 +231,12 @@ export default function ManageUsers() {
></i>
) : null}
{showUserDelete(authUser, user) && (
<ButtonV2
variant="danger"
ghost
border
className="float-right"
<div
className="w-8 cursor-pointer rounded-lg bg-red-50 text-xl text-red-600 hover:bg-red-50 hover:text-red-700"
onClick={() => handleDelete(user)}
>
Delete
</ButtonV2>
<CareIcon icon="l-trash" className="ml-[5px]" />
</div>
)}
</div>

Expand Down
Loading