Skip to content

Commit

Permalink
changed weekly to average weekly for working hours
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijv256 committed Sep 5, 2023
1 parent b258926 commit 298e59d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
13 changes: 8 additions & 5 deletions src/Components/Users/ManageUsers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,10 @@ export default function ManageUsers() {
)}
</div>
<div>
<UserDetails id="working-hours" title="Weekly working hours">
<UserDetails
id="working-hours"
title="Average weekly working hours"
>
{user.weekly_working_hours ? (
<span className="font-semibold">
{user.weekly_working_hours} hours
Expand Down Expand Up @@ -438,7 +441,7 @@ export default function ManageUsers() {
}}
>
<CareIcon className="care-l-clock text-xl" />
<p>Set weekly working hours</p>
<p>Set Average weekly working hours</p>
</ButtonV2>
</div>
)}
Expand Down Expand Up @@ -492,15 +495,15 @@ export default function ManageUsers() {
open={expandWorkingHours}
setOpen={setExpandWorkingHours}
slideFrom="right"
title="Weekly working hours"
title="Average weekly working hours"
dialogClass="md:w-[400px]"
onCloseClick={() => {
setWeeklyHours(0);
}}
>
<div className="px-2">
<dt className="mb-3 text-sm font-medium leading-5 text-black">
Set weekly working hours for {selectedUser}
Set Average weekly working hours for {selectedUser}
</dt>
<TextFormField
name="weekly_working_hours"
Expand All @@ -511,7 +514,7 @@ export default function ManageUsers() {
}}
error={
weeklyHours < 0 || weeklyHours > 168
? "Weekly working hours should be between 0 and 168"
? "Average weekly working hours should be between 0 and 168"
: ""
}
required
Expand Down
9 changes: 4 additions & 5 deletions src/Components/Users/UserProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ export default function UserProfile() {
!/^\d+$/.test(states.form[field] ?? "")
) {
errors[field] =
"Weekly working hours must be a number between 0 and 168";
"Average weekly working hours must be a number between 0 and 168";
invalidForm = true;
}
return;
Expand Down Expand Up @@ -416,7 +416,7 @@ export default function UserProfile() {
};
return (
<div>
<div className="p-10 lg:p-20">
<div className="p-10 lg:p-16">
<div className="lg:grid lg:grid-cols-3 lg:gap-6">
<div className="lg:col-span-1">
<div className="px-4 sm:px-0">
Expand Down Expand Up @@ -559,7 +559,7 @@ export default function UserProfile() {
</div>
<div className="my-2 sm:col-span-1">
<dt className="text-sm font-medium leading-5 text-black">
Weekly working hours
Average weekly working hours
</dt>
<dd className="mt-1 text-sm leading-5 text-gray-900">
{details.weekly_working_hours ?? "-"}
Expand All @@ -568,7 +568,6 @@ export default function UserProfile() {
</dl>
</div>
)}

{showEdit && (
<div className="space-y-4">
<form action="#" method="POST">
Expand Down Expand Up @@ -661,7 +660,7 @@ export default function UserProfile() {
<TextFormField
{...fieldProps("weekly_working_hours")}
required
label="Weekly working hours"
label="Average weekly working hours"
className="col-span-6 sm:col-span-3"
type="number"
min={0}
Expand Down

0 comments on commit 298e59d

Please sign in to comment.