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 User page Spacing and added translations #8462

Merged
merged 3 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
22 changes: 10 additions & 12 deletions src/Components/Facility/FacilityUsers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export default function FacilityUsers(props: any) {
const [currentPage, setCurrentPage] = useState(1);
const [expandFacilityList, setExpandFacilityList] = useState(false);
const [selectedUser, setSelectedUser] = useState<any | null>(null);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [offset, setOffset] = useState(0);

const [linkFacility, setLinkFacility] = useState<{
Expand Down Expand Up @@ -103,7 +102,7 @@ export default function FacilityUsers(props: any) {
onResponse: ({ res }) => {
if (res?.status === 204) {
Notification.Success({
msg: "User deleted successfully",
msg: t("user_deleted_successfuly"),
});
}
},
Expand Down Expand Up @@ -152,7 +151,7 @@ export default function FacilityUsers(props: any) {
</div>
)}
<div className="min-width-50 shrink-0 text-sm text-secondary-600">
Last Online:{" "}
{t("last_online")}{" "}
<span
aria-label="Online"
className={
Expand All @@ -165,7 +164,7 @@ export default function FacilityUsers(props: any) {
<span className="pl-2">
{user.last_login
? relativeTime(user.last_login)
: "Never"}
: t("never")}
</span>
</div>
</div>
Expand All @@ -189,7 +188,7 @@ export default function FacilityUsers(props: any) {
<div className="flex justify-between py-4">
<div>
<div className="leading-relaxed text-secondary-500">
Phone:
{t("phone_number")}
</div>
<a
href={`tel:${user.phone_number}`}
Expand All @@ -214,7 +213,7 @@ export default function FacilityUsers(props: any) {
}}
>
<CareIcon icon="l-hospital" className="text-lg" />
<p>Linked Facilities</p>
<p>{t("linked_facilities")}</p>
</ButtonV2>
</UserDetails>
)}
Expand Down Expand Up @@ -250,17 +249,16 @@ export default function FacilityUsers(props: any) {
manageUsers = (
<div>
<div>
<h5> No Users Found</h5>
<h5>{t("no_users_found")}</h5>
</div>
</div>
);
}

return (
<Page
title={`Users - ${facilityData?.name}`}
title={`${t("users")} - ${facilityData?.name}`}
hideBack={true}
className="mx-3 md:mx-8"
breadcrumbs={false}
>
{linkFacility.show && (
Expand All @@ -271,10 +269,10 @@ export default function FacilityUsers(props: any) {
/>
)}

<div className="m-4 mt-5 grid grid-cols-1 sm:grid-cols-3 md:gap-5 md:px-4">
<div className="mt-5 grid grid-cols-1 sm:grid-cols-3 md:gap-5">
{facilityUserData && (
<CountBlock
text="Total Users"
text={t("total_users")}
count={facilityUserData.count}
loading={isLoading}
icon="l-user-injured"
Expand All @@ -291,7 +289,7 @@ export default function FacilityUsers(props: any) {
>
<UserFacilities user={selectedUser} />
</SlideOverCustom>
<div className="px-3 md:px-8">
<div className="">
khavinshankar marked this conversation as resolved.
Show resolved Hide resolved
<div>{manageUsers}</div>
</div>
{userData.show && (
Expand Down
6 changes: 4 additions & 2 deletions src/Locale/en/Common.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,5 +193,7 @@
"live": "Live",
"discharged": "Discharged",
"archived": "Archived",
"no_changes_made": "No changes made"
}
"no_changes_made": "No changes made",
"user_deleted_successfuly": "User Deleted Successfuly",
"users": "Users"
}
6 changes: 4 additions & 2 deletions src/Locale/en/Users.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
"add_new_user": "Add New User",
"no_users_found": "No Users Found",
"home_facility": "Home Facility",
"no_home_facility" : "No home facility assigned",
"no_home_facility": "No home facility assigned",
"clear_home_facility": "Clear Home Facility",
"linked_facilities": "Linked Facilities",
"no_linked_facilities": "No Linked Facilities",
"average_weekly_working_hours": "Average weekly working hours",
"set_average_weekly_working_hours_for": "Set Average weekly working hours for",
"search_by_username": "Search by username"
"search_by_username": "Search by username",
"last_online": "Last Online",
"total_users": "Total Users"
}
Loading