From e21cfff50b4dea60c84703388a64a547ae25988c Mon Sep 17 00:00:00 2001 From: abhijeetkhokhar Date: Sat, 1 Mar 2025 20:41:38 +0530 Subject: [PATCH] responsivness fix --- public/locale/en.json | 5 +++++ src/pages/UserDashboard.tsx | 34 +++++++++++++++++++++------------- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/public/locale/en.json b/public/locale/en.json index c57873f2b10..9d6df393904 100644 --- a/public/locale/en.json +++ b/public/locale/en.json @@ -333,6 +333,7 @@ "address": "Address", "address_is_required": "Address is required", "adjust_resource_filters": "Try adjusting your filters or create a new resource", + "admin_dashboard": "Admin Dashboard", "administer": "Administer", "administer_medicine": "Administer Medicine", "administer_medicines": "Administer Medicines", @@ -2538,6 +2539,7 @@ "view_details": "View Details", "view_encounter": "View Encounter", "view_facility": "View Facility", + "view_facility_details": "View facility details", "view_files": "View Files", "view_patient": "View Patient", "view_patients": "View Patients", @@ -2565,6 +2567,7 @@ "we_ve_sent_you_a_code_to": "We've sent you a code to", "weekly_schedule": "Weekly Schedule", "weekly_working_hours_error": "Average weekly working hours must be a number between 0 and 168", + "welcome_back_name": "Welcome Back {{name}} !", "welcome_back_to_hospital_dashboard": "Welcome back to the overview ", "what_facility_assign_the_patient_to": "What facility would you like to assign the patient to", "whatsapp_number": "Whatsapp Number", @@ -2584,6 +2587,8 @@ "yesterday": "Yesterday", "yet_to_be_decided": "Yet to be decided", "you_need_at_least_a_location_to_create_an_assest": "You need at least a location to create an assest.", + "your_facilities": "Your Facilities", + "your_organizations": "Your Organizations", "zoom_in": "Zoom In", "zoom_out": "Zoom Out" } diff --git a/src/pages/UserDashboard.tsx b/src/pages/UserDashboard.tsx index 573d51c0032..104c55230ca 100644 --- a/src/pages/UserDashboard.tsx +++ b/src/pages/UserDashboard.tsx @@ -1,5 +1,6 @@ import { ChevronRight, LogOut, Settings, User2Icon } from "lucide-react"; import { Link } from "raviger"; +import { useTranslation } from "react-i18next"; import { Button } from "@/components/ui/button"; import { Card, CardContent } from "@/components/ui/card"; @@ -15,21 +16,23 @@ export default function UserDashboard() { const user = useAuthUser(); const { signOut } = useAuthContext(); const facilities = user.facilities || []; + const { t } = useTranslation(); + const organizations = user.organizations || []; return (
{/* Welcome Section */} -
+
-
+

- Welcome back, {user.first_name}! + {t("welcome_back_name", { name: user.first_name })}

{new Date().toLocaleDateString("en-US", { @@ -41,7 +44,7 @@ export default function UserDashboard() {

-
+
{user.is_superuser && ( @@ -63,9 +66,12 @@ export default function UserDashboard() { className="w-full sm:w-auto" asChild > - + - Admin Dashboard + {t("admin_dashboard")} )} @@ -73,10 +79,10 @@ export default function UserDashboard() { variant="outline" size="sm" className="w-full sm:w-auto" - onClick={() => signOut()} + onClick={signOut} > - Sign Out + {t("sign_out")}
@@ -84,7 +90,7 @@ export default function UserDashboard() { {/* Facilities Section */} {facilities.length > 0 && (
-

Your Facilities

+

{t("your_facilities")}

- View facility details + {t("view_facility_details")}

@@ -120,7 +126,9 @@ export default function UserDashboard() { {/* Organizations Section */} {organizations.length > 0 && (
-

Your Organizations

+

+ {t("your_organizations")} +