Skip to content

Commit

Permalink
UI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashesh3 committed Aug 2, 2023
1 parent 0558e7b commit d22c85b
Showing 1 changed file with 29 additions and 26 deletions.
55 changes: 29 additions & 26 deletions src/Components/Users/ManageUsers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export default function ManageUsers() {
id={`usr_${idx}`}
className=" mt-6 w-full md:px-4 lg:w-1/2 xl:w-1/3"
>
<div className="relative block h-full cursor-pointer overflow-visible rounded-lg bg-white shadow hover:border-primary-500">
<div className="relative block h-full overflow-visible rounded-lg bg-white shadow hover:border-primary-500">
<div className="flex h-full flex-col justify-between">
<div className="px-6 py-4">
<div
Expand Down Expand Up @@ -277,6 +277,7 @@ export default function ManageUsers() {
variant="danger"
ghost
border
className="float-right"
onClick={() => handleDelete(user)}
>
Delete
Expand All @@ -289,10 +290,10 @@ export default function ManageUsers() {
isExtremeSmallScreen
? " flex-wrap "
: " flex-col justify-between md:flex-row "
} gap-2 md:grid md:grid-cols-4`}
} gap-2 md:grid md:grid-cols-2`}
>
{user.user_type && (
<div className="col-span-2">
<div className="col-span-1">
<UserDetails id="role" title="Role">
<div className="break-all font-semibold">
{user.user_type}
Expand All @@ -301,7 +302,7 @@ export default function ManageUsers() {
</div>
)}
{user.district_object && (
<div className="col-span-2">
<div className="col-span-1">
<UserDetails id="district" title="District">
<div className="font-semibold">
{user.district_object.name}
Expand All @@ -311,7 +312,7 @@ export default function ManageUsers() {
)}
{user.user_type === "Doctor" && (
<>
<div className="col-span-2">
<div className="col-span-1">
<UserDetails
id="doctor-qualification"
title="Qualification"
Expand All @@ -325,7 +326,7 @@ export default function ManageUsers() {
)}
</UserDetails>
</div>
<div className="col-span-2">
<div className="col-span-1">
<UserDetails id="doctor-experience" title="Experience">
{user.doctor_experience_commenced_on ? (
<span className="font-semibold">
Expand Down Expand Up @@ -369,11 +370,11 @@ export default function ManageUsers() {
className={`${
isExtremeSmallScreen
? "flex flex-wrap "
: "grid grid-cols-4 "
: "grid grid-cols-2 "
}`}
>
{user.created_by && (
<div className="col-span-2">
<div className="col-span-1">
<UserDetails id="created_by" title="Created by">
<div className="break-all font-semibold">
{user.created_by}
Expand All @@ -382,7 +383,7 @@ export default function ManageUsers() {
</div>
)}
{user.username && (
<div className="col-span-2">
<div className="col-span-1">
<UserDetails id="home_facility" title="Home Facility">
<span className="block font-semibold">
{user.home_facility_object?.name ||
Expand Down Expand Up @@ -418,7 +419,7 @@ export default function ManageUsers() {
<CareIcon className="care-l-hospital text-lg" />
<p>Linked Facilities</p>
</ButtonV2>
<div className="mx-1"></div>
<div className="mx-1 my-2 sm:my-0"></div>
<ButtonV2
id="skills"
className="flex w-full items-center md:w-1/2"
Expand All @@ -431,20 +432,22 @@ export default function ManageUsers() {
<p>Linked Skills</p>
</ButtonV2>
</div>
<div className="flex-col md:flex-row">
<ButtonV2
id="skills"
className="flex w-full items-center md:w-full"
onClick={() => {
setExpandWorkingHours(true);
setSelectedUser(user.username);
setWeeklyHours(user.weekly_working_hours);
}}
>
<CareIcon className="care-l-clock text-xl" />
<p>Set weekly working hours</p>
</ButtonV2>
</div>
{["DistrictAdmin", "StateAdmin"].includes(userType) && (
<div className="flex-col md:flex-row">
<ButtonV2
id="skills"
className="flex w-full items-center md:w-full"
onClick={() => {
setExpandWorkingHours(true);
setSelectedUser(user.username);
setWeeklyHours(user.weekly_working_hours);
}}
>
<CareIcon className="care-l-clock text-xl" />
<p>Set weekly working hours</p>
</ButtonV2>
</div>
)}
</div>
)}
</div>
Expand Down Expand Up @@ -723,7 +726,7 @@ function UserFacilities(props: { user: any }) {
{user?.home_facility_object && (
<div className="mt-2">
<div className="mb-2 ml-2 text-lg font-bold">Home Facility</div>
<div className="relative cursor-pointer rounded p-2 transition hover:bg-gray-200 focus:bg-gray-200 md:rounded-lg">
<div className="relative rounded p-2 transition hover:bg-gray-200 focus:bg-gray-200 md:rounded-lg">
<div className="flex items-center justify-between">
<span>{user?.home_facility_object?.name}</span>
<div className="flex items-center gap-2">
Expand Down Expand Up @@ -767,7 +770,7 @@ function UserFacilities(props: { user: any }) {
id={`facility_${i}`}
key={`facility_${i}`}
className={classNames(
"relative cursor-pointer rounded p-2 transition hover:bg-gray-200 focus:bg-gray-200 md:rounded-lg"
"relative rounded p-2 transition hover:bg-gray-200 focus:bg-gray-200 md:rounded-lg"
)}
>
<div className="flex items-center justify-between">
Expand Down

0 comments on commit d22c85b

Please sign in to comment.