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: Overflow for switchers in sidebar, Avatar size in notes tab, Textbox expansion in Add Facility #10005

Merged
merged 6 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
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
2 changes: 2 additions & 0 deletions public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1325,6 +1325,7 @@
"move_to_onvif_preset": "Move to an ONVIF Preset",
"moving_camera": "Moving Camera",
"my_doctors": "My Doctors",
"my_organizations": "My Organizations",
"my_profile": "My Profile",
"my_schedules": "My Schedules",
"name": "Name",
Expand Down Expand Up @@ -1852,6 +1853,7 @@
"select_location_first": "Select Location First",
"select_method": "Select method",
"select_new_role": "Select New Role",
"select_organization": "Select Organization",
"select_patient": "Select Patient",
"select_policy": "Select an Insurance Policy",
"select_policy_to_add_items": "Select a Policy to Add Items",
Expand Down
6 changes: 3 additions & 3 deletions src/components/Common/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const Avatar = React.forwardRef<
return (
<AvatarPrimitive.Root
ref={ref}
className={cn("w-full h-full", className)}
className={cn(className, "flex items-center justify-center")}
Rishith25 marked this conversation as resolved.
Show resolved Hide resolved
Rishith25 marked this conversation as resolved.
Show resolved Hide resolved
style={{
background: bgColor,
}}
Expand All @@ -66,15 +66,15 @@ const Avatar = React.forwardRef<
<AvatarPrimitive.Image
src={imageUrl}
alt={name}
className="aspect-square h-full w-full object-cover"
className="aspect-square object-cover"
Rishith25 marked this conversation as resolved.
Show resolved Hide resolved
/>
) : (
<AvatarPrimitive.Fallback className="flex h-full w-full select-none items-center justify-center text-center">
<svg
xmlns="http://www.w3.org/2000/svg"
version="1.1"
viewBox="0 0 100 100"
className="aspect-square h-full w-full object-cover"
className="aspect-square object-cover"
Rishith25 marked this conversation as resolved.
Show resolved Hide resolved
>
<text
fill={textColor}
Expand Down
2 changes: 0 additions & 2 deletions src/components/Facility/CreateFacilityForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ export default function CreateFacilityForm({
{...field}
data-cy="facility-description"
placeholder="Describe your facility (Markdown supported)"
className="h-24"
/>
</FormControl>
<FormMessage />
Expand Down Expand Up @@ -305,7 +304,6 @@ export default function CreateFacilityForm({
{...field}
data-cy="facility-address"
placeholder="Enter complete address"
className="h-20"
/>
</FormControl>
<FormMessage />
Expand Down
9 changes: 7 additions & 2 deletions src/components/ui/sidebar/facility-switcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { Hospital } from "lucide-react";
import { navigate } from "raviger";
import { useTranslation } from "react-i18next";

import { cn } from "@/lib/utils";

import {
DropdownMenu,
DropdownMenuContent,
Expand Down Expand Up @@ -51,7 +53,7 @@ export function FacilitySwitcher({
</SidebarMenuButton>
</DropdownMenuTrigger>
<DropdownMenuContent
className="w-[--radix-dropdown-menu-trigger-width] min-w-56 rounded-lg"
className="w-[--radix-dropdown-menu-trigger-width] min-w-56 rounded-lg max-h-screen overflow-y-auto"
align="start"
side={isMobile ? "bottom" : "right"}
sideOffset={4}
Expand All @@ -72,7 +74,10 @@ export function FacilitySwitcher({
setOpenMobile(false);
}
}}
className="gap-2 p-2"
className={cn("gap-2 p-2", {
"bg-primary-500 text-white":
facility.name === selectedFacility?.name,
})}
>
<div className="flex size-6 items-center justify-center rounded-sm border">
<Hospital className="size-4 shrink-0" />
Expand Down
18 changes: 13 additions & 5 deletions src/components/ui/sidebar/organization-switcher.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { CaretSortIcon, DashboardIcon } from "@radix-ui/react-icons";
import { Globe } from "lucide-react";
import { navigate } from "raviger";
import { useTranslation } from "react-i18next";

import { cn } from "@/lib/utils";

import {
DropdownMenu,
Expand Down Expand Up @@ -29,6 +32,7 @@ export function OrganizationSwitcher({
selectedOrganization,
}: Props) {
const { isMobile, setOpenMobile } = useSidebar();
const { t } = useTranslation();

return (
<DropdownMenu>
Expand All @@ -45,8 +49,8 @@ export function OrganizationSwitcher({
<div className="grid flex-1 text-left text-sm leading-tight">
<span className="truncate font-semibold">
{selectedOrganization
? "My Organizations"
: "Select Organization"}
? t("my_organizations")
: t("select_organization")}
</span>
</div>
<CaretSortIcon className="ml-auto" />
Expand All @@ -55,16 +59,16 @@ export function OrganizationSwitcher({
</SidebarMenu>
</DropdownMenuTrigger>
<DropdownMenuContent
className="w-[--radix-dropdown-menu-trigger-width] min-w-56 rounded-lg"
className="w-[--radix-dropdown-menu-trigger-width] min-w-56 rounded-lg max-h-screen overflow-y-auto"
align="start"
side={isMobile ? "bottom" : "right"}
sideOffset={4}
>
<DropdownMenuItem onClick={() => navigate("/")}>
<DashboardIcon className="size-4" />
View Dashboard
{t("view_dashboard")}
</DropdownMenuItem>
<DropdownMenuLabel>Organizations</DropdownMenuLabel>
<DropdownMenuLabel>{t("organizations")}</DropdownMenuLabel>
<DropdownMenuSeparator />
{organizations.map((org) => (
<DropdownMenuItem
Expand All @@ -75,6 +79,10 @@ export function OrganizationSwitcher({
setOpenMobile(false);
}
}}
className={cn("gap-2 p-2", {
"bg-primary-500 text-white":
org?.name === selectedOrganization?.name,
})}
Rishith25 marked this conversation as resolved.
Show resolved Hide resolved
>
{org.name}
</DropdownMenuItem>
Expand Down
Loading