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

Fix PatientUsers card overflow and Remove-button background #10172

Open
wants to merge 27 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f8f0f59
Fix `PatientUsers` card overflow and Remove-btn bg
rajku-dev Jan 25, 2025
ddfdaa0
Merge branch 'develop' into issue/10158/patient-user-card-fix
rajku-dev Jan 25, 2025
9e14a9b
Merge branch 'develop' into issue/10158/patient-user-card-fix
rajku-dev Jan 25, 2025
347e49d
use tooltip component
rajku-dev Jan 26, 2025
661138e
Merge branch 'develop' into issue/10158/patient-user-card-fix
rajku-dev Jan 27, 2025
d0e8568
Merge branch 'develop' into issue/10158/patient-user-card-fix
rajku-dev Jan 27, 2025
1dd2ccb
reduce max-w
rajku-dev Jan 29, 2025
01b6829
Merge branch 'develop' into issue/10158/patient-user-card-fix
rajku-dev Jan 29, 2025
51af025
Merge branch 'develop' into issue/10158/patient-user-card-fix
rajku-dev Jan 30, 2025
2f77e93
Merge branch 'develop' into issue/10158/patient-user-card-fix
rajku-dev Jan 30, 2025
4ca15e0
Merge branch 'develop' into issue/10158/patient-user-card-fix
rajku-dev Jan 31, 2025
49f615b
Merge remote-tracking branch 'upstream/develop' into issue/10158/pati…
rajku-dev Jan 31, 2025
e05cd94
Merge branch 'issue/10158/patient-user-card-fix' of https://github.co…
rajku-dev Jan 31, 2025
1796cd8
Merge branch 'develop' into issue/10158/patient-user-card-fix
rajku-dev Jan 31, 2025
926cfa8
fix trash icon alignment
rajku-dev Jan 31, 2025
ef79fab
Merge branch 'issue/10158/patient-user-card-fix' of https://github.co…
rajku-dev Jan 31, 2025
a8a1791
make the card resposive for all viewports
rajku-dev Jan 31, 2025
3c7cf72
Merge branch 'develop' into issue/10158/patient-user-card-fix
rajku-dev Jan 31, 2025
710b57f
Merge branch 'develop' into issue/10158/patient-user-card-fix
rajku-dev Jan 31, 2025
835bae6
Merge branch 'develop' into issue/10158/patient-user-card-fix
rajku-dev Feb 1, 2025
d6eb604
fix css
rajku-dev Feb 3, 2025
0d44a1d
Merge branch 'issue/10158/patient-user-card-fix' of https://github.co…
rajku-dev Feb 3, 2025
2f15f7d
Merge branch 'develop' into issue/10158/patient-user-card-fix
rajku-dev Feb 3, 2025
6a751ce
Merge branch 'develop' into issue/10158/patient-user-card-fix
rajku-dev Feb 3, 2025
bde8648
Merge branch 'develop' into issue/10158/patient-user-card-fix
rajku-dev Feb 4, 2025
1181e5a
Merge branch 'develop' into issue/10158/patient-user-card-fix
rajku-dev Feb 4, 2025
34c55dc
Merge branch 'develop' into issue/10158/patient-user-card-fix
rajku-dev Feb 4, 2025
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
34 changes: 27 additions & 7 deletions src/components/Patient/PatientDetailsTab/PatientUsers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ import {
SheetTitle,
SheetTrigger,
} from "@/components/ui/sheet";
import {
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@/components/ui/tooltip";

import { Avatar } from "@/components/Common/Avatar";
import UserSelector from "@/components/Common/UserSelector";
Expand Down Expand Up @@ -236,7 +241,7 @@ export const PatientUsers = (props: PatientProps) => {
const ManageUsers = () => {
if (!users?.results?.length) {
return (
<div className="h-full text-center space-y-2 mt-2 text-center rounded-lg bg-white px-7 py-12 border border-secondary-300 text-lg text-secondary-600">
<div className="h-full space-y-2 mt-2 text-center rounded-lg bg-white px-7 py-12 border border-secondary-300 text-lg text-secondary-600">
{t("no_user_assigned")}
</div>
);
Expand All @@ -246,7 +251,7 @@ export const PatientUsers = (props: PatientProps) => {
{users?.results.map((user) => (
<div
key={user.id}
className="rounded-lg border border-gray-200 bg-white p-4 shadow-sm"
className="rounded-lg border border-gray-200 bg-white p-4 shadow-sm relative"
>
<div className="flex items-start justify-between">
<div className="flex items-start space-x-4">
Expand All @@ -256,16 +261,31 @@ export const PatientUsers = (props: PatientProps) => {
imageUrl={user.profile_picture_url}
/>
<div>
<h3 className="text-sm font-medium text-gray-900">
{formatDisplayName(user)}
<h3 className="text-sm font-medium text-gray-900 truncate w-full max-w-32 sm:max-w-96 md:max-w-24 lg:max-w-28">
<Tooltip>
<TooltipTrigger>{formatDisplayName(user)}</TooltipTrigger>
<TooltipContent>
<p>{formatDisplayName(user)}</p>
</TooltipContent>
</Tooltip>
</h3>
<p className="text-sm text-gray-500">{user.username}</p>
<p className="text-sm text-gray-500 truncate sm:max-w-96 md:max-w-32 lg:max-w-32">
<Tooltip>
<TooltipTrigger>{user.username}</TooltipTrigger>
<TooltipContent>
<p>{user.username}</p>
</TooltipContent>
</Tooltip>
</p>
</div>
</div>
<AlertDialog>
<AlertDialogTrigger asChild>
<Button variant="ghost" size="icon">
<CareIcon icon="l-trash" className="h-4 w-4" />
<CareIcon
icon="l-trash"
className="h-4 w-4 absolute top-2 right-2"
/>
</Button>
</AlertDialogTrigger>
<AlertDialogContent>
Expand All @@ -281,7 +301,7 @@ export const PatientUsers = (props: PatientProps) => {
<AlertDialogCancel>{t("cancel")}</AlertDialogCancel>
<AlertDialogAction
onClick={() => removeUser(user.id)}
className="bg-destructive text-destructive-foreground hover:bg-destructive/90"
className="bg-red-500 text-white hover:bg-red-600"
>
{t("remove")}
</AlertDialogAction>
Expand Down
Loading