Skip to content

Commit

Permalink
Fix: Overflow for switchers in sidebar, Avatar size in notes tab, Tex…
Browse files Browse the repository at this point in the history
…tbox expansion in Add Facility (#10005)
  • Loading branch information
Rishith25 authored Jan 16, 2025
1 parent 58c8a7a commit cae4451
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
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
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
10 changes: 8 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,11 @@ export function FacilitySwitcher({
setOpenMobile(false);
}
}}
className="gap-2 p-2"
className={cn(
"gap-2 p-2",
facility.name === selectedFacility?.name &&
"bg-primary-500 text-white",
)}
>
<div className="flex size-6 items-center justify-center rounded-sm border">
<Hospital className="size-4 shrink-0" />
Expand Down
19 changes: 14 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,11 @@ export function OrganizationSwitcher({
setOpenMobile(false);
}
}}
className={cn(
"gap-2 p-2",
org?.name === selectedOrganization?.name &&
"bg-primary-500 text-white",
)}
>
{org.name}
</DropdownMenuItem>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Encounters/tabs/EncounterNotesTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const MessageItem = ({ message }: { message: Message }) => {
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<div className="flex-shrink-0">
<div className="flex">
<Avatar
name={message.created_by.username}
imageUrl={message.created_by.profile_picture_url}
Expand Down

0 comments on commit cae4451

Please sign in to comment.