Skip to content

Commit

Permalink
Merge branch 'main' into refactor-pricing
Browse files Browse the repository at this point in the history
  • Loading branch information
DonKoko authored May 8, 2024
2 parents e158902 + e908356 commit a955ea6
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 27 deletions.
3 changes: 0 additions & 3 deletions app/components/booking/availability-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ export function AvailabilitySelect() {
position="popper"
align="end"
sideOffset={4}
ref={(ref) =>
ref?.addEventListener("touchend", (e) => e.preventDefault())
}
>
<div className="max-h-[320px] overflow-auto">
<SelectItem
Expand Down
9 changes: 1 addition & 8 deletions app/components/custody/custodian-user-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,7 @@ export default function CustodianUserSelect(
<SelectValue placeholder="Select a team member" />
</SelectTrigger>
<div>
<SelectContent
className="w-[352px]"
position="popper"
align="start"
ref={(ref) =>
ref?.addEventListener("touchend", (e) => e.preventDefault())
}
>
<SelectContent className="w-[352px]" position="popper" align="start">
{teamMembers.length > 0 ? (
<div className=" max-h-[320px] overflow-auto">
{teamMembers.map((member) => (
Expand Down
6 changes: 4 additions & 2 deletions app/components/forms/select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ const SelectTrigger = React.forwardRef<
const SelectContent = React.forwardRef<
React.ElementRef<typeof SelectPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
>(function SelectContent({ className, children, ...props }, ref) {
>(function SelectContent({ className, children, ...props }, _ref) {
return (
<SelectPrimitive.Portal>
<SelectPrimitive.Content
ref={ref}
ref={(ref) =>
ref?.addEventListener("touchend", (e) => e.preventDefault())
}
className={tw(
" relative z-50 overflow-hidden rounded border border-gray-300 bg-white p-3 shadow-md animate-in fade-in-80",
className
Expand Down
5 changes: 3 additions & 2 deletions app/components/icons/library.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ export function ItemsIcon(props: SVGProps<SVGSVGElement>) {
export function SettingsIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg
width={22}
height={22}
width="100%"
height="100%"
viewBox="0 0 22 22"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{...props}
Expand Down
10 changes: 7 additions & 3 deletions app/components/layout/sidebar/menu-items.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ const MenuItems = ({ fetcher }: { fetcher: FetcherWithComponents<any> }) => {
onClick={toggleMobileNav}
title={item.label}
>
<i className="icon pl-[2px] text-gray-500">{item.icon}</i>
<i className="icon inline-flex pl-[2px] text-gray-500">
{item.icon}
</i>
<span className="text whitespace-nowrap transition duration-200 ease-linear">
{item.label}
</span>
Expand Down Expand Up @@ -145,7 +147,9 @@ const MenuItems = ({ fetcher }: { fetcher: FetcherWithComponents<any> }) => {
onClick={toggleMobileNav}
title={item.label}
>
<i className="icon pl-[2px] text-gray-500">{item.icon}</i>
<i className="icon inline-flex pl-[2px] text-gray-500">
{item.icon}
</i>
<span className="text whitespace-nowrap transition duration-200 ease-linear">
{item.label}
</span>
Expand All @@ -169,7 +173,7 @@ const MenuItems = ({ fetcher }: { fetcher: FetcherWithComponents<any> }) => {
workspaceSwitching ? "pointer-events-none" : ""
)}
>
<i className="icon pl-[2px] text-gray-500">
<i className="icon inline-flex pl-[2px] text-gray-500">
<Icon icon="switch" />
</i>
<span className="text whitespace-nowrap transition duration-200 ease-linear">
Expand Down
9 changes: 1 addition & 8 deletions app/components/layout/sidebar/organization-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,7 @@ export const OrganizationSelect = ({
<SelectTrigger className="w-full px-3 py-2">
<SelectValue />
</SelectTrigger>
<SelectContent
position="popper"
className="w-full"
align="start"
ref={(ref) =>
ref?.addEventListener("touchend", (e) => e.preventDefault())
}
>
<SelectContent position="popper" className="w-full" align="start">
<div className=" max-h-[320px] w-[253px] overflow-auto">
{organizations.map((org) => (
<SelectItem
Expand Down
1 change: 1 addition & 0 deletions app/routes/_layout+/locations.$locationId.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ export default function LocationPage() {
to="add-assets"
variant="primary"
icon="plus"
className="whitespace-nowrap"
>
Manage assets
</Button>
Expand Down
9 changes: 8 additions & 1 deletion app/utils/use-controlled-dropdown-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ export function useControlledDropdownMenu(

useEffect(() => {
const handleClickOutside = (event: MouseEvent) => {
if (ref.current && !ref.current.contains(event.target as Node)) {
const target = event.target as Node;
const alertDialog = document.querySelector('[role="alertdialog"]');

if (
ref.current &&
!ref.current.contains(target) &&
(!alertDialog || !alertDialog.contains(target))
) {
setOpen(false);
}
};
Expand Down

0 comments on commit a955ea6

Please sign in to comment.