Skip to content

Commit b546180

Browse files
committed
test7
1 parent 0710efa commit b546180

File tree

2 files changed

+75
-45
lines changed

2 files changed

+75
-45
lines changed

src/components/ui/popover.tsx

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,37 @@
11
'use client';
22

33
import * as React from 'react';
4-
import * as PopoverPrimitive from '@radix-ui/react-popover';
4+
// Commenting out to test if this is causing the useLayoutEffect error
5+
// import * as PopoverPrimitive from '@radix-ui/react-popover';
56

67
import { cn } from '@/lib/utils';
78

8-
const Popover = PopoverPrimitive.Root;
9+
// Creating mock components to replace Radix UI Popover
10+
const Popover: React.FC<{ children: React.ReactNode }> = ({ children }) => <>{children}</>;
11+
const PopoverTrigger: React.FC<{ children: React.ReactNode }> = ({ children }) => <>{children}</>;
12+
const PopoverContent: React.FC<{ children: React.ReactNode, className?: string }> = ({ children, className }) =>
13+
<div className={cn('hidden', className)}>{children}</div>;
914

10-
const PopoverTrigger = PopoverPrimitive.Trigger;
11-
12-
const PopoverContent = React.forwardRef<
13-
React.ElementRef<typeof PopoverPrimitive.Content>,
14-
React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
15-
>(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (
16-
<PopoverPrimitive.Portal>
17-
<PopoverPrimitive.Content
18-
ref={ref}
19-
align={align}
20-
sideOffset={sideOffset}
21-
// onClick={() => console.log('PopoverContent clicked')}
22-
className={cn(
23-
'z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
24-
className
25-
)}
26-
{...props}
27-
/>
28-
</PopoverPrimitive.Portal>
29-
));
30-
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
15+
// Commenting out the original implementation
16+
// const Popover = PopoverPrimitive.Root;
17+
// const PopoverTrigger = PopoverPrimitive.Trigger;
18+
// const PopoverContent = React.forwardRef<
19+
// React.ElementRef<typeof PopoverPrimitive.Content>,
20+
// React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
21+
// >(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (
22+
// <PopoverPrimitive.Portal>
23+
// <PopoverPrimitive.Content
24+
// ref={ref}
25+
// align={align}
26+
// sideOffset={sideOffset}
27+
// className={cn(
28+
// 'z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
29+
// className
30+
// )}
31+
// {...props}
32+
// />
33+
// </PopoverPrimitive.Portal>
34+
// ));
35+
// PopoverContent.displayName = PopoverPrimitive.Content.displayName;
3136

3237
export { Popover, PopoverTrigger, PopoverContent };

src/components/ui/tooltip.tsx

Lines changed: 47 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,55 @@
11
'use client';
22

33
import * as React from 'react';
4-
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
4+
// Commenting out to test if this is causing the useLayoutEffect error
5+
// import * as TooltipPrimitive from '@radix-ui/react-tooltip';
56

67
import { cn } from '@/lib/utils';
78

8-
const TooltipProvider = TooltipPrimitive.Provider;
9-
10-
const Tooltip = TooltipPrimitive.Root;
11-
12-
const TooltipTrigger = TooltipPrimitive.Trigger;
13-
14-
const TooltipContent = React.forwardRef<
15-
React.ElementRef<typeof TooltipPrimitive.Content>,
16-
React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
17-
>(({ className, sideOffset = 4, ...props }, ref) => (
18-
<TooltipPrimitive.Content
19-
ref={ref}
20-
sideOffset={sideOffset}
21-
className={cn(
22-
'z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
23-
className
24-
)}
25-
{...props}
26-
/>
27-
));
28-
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
9+
// Creating mock components to replace Radix UI Tooltip
10+
// This will disable all tooltips but will let us test if they're causing the error
11+
type TooltipProviderProps = { children: React.ReactNode };
12+
const TooltipProvider: React.FC<TooltipProviderProps> = ({ children }) => <>{children}</>;
13+
14+
type TooltipProps = { children: React.ReactNode };
15+
const Tooltip: React.FC<TooltipProps> = ({ children }) => <>{children}</>;
16+
17+
type TooltipTriggerProps = { children: React.ReactNode, asChild?: boolean };
18+
const TooltipTrigger: React.FC<TooltipTriggerProps> = ({ children }) => <>{children}</>;
19+
20+
type TooltipContentProps = {
21+
children: React.ReactNode,
22+
className?: string,
23+
sideOffset?: number,
24+
[key: string]: any
25+
};
26+
const TooltipContent = React.forwardRef<HTMLDivElement, TooltipContentProps>(
27+
({ children, className, ...props }, ref) => (
28+
<div ref={ref} className={cn('hidden', className)} {...props}>
29+
{children}
30+
</div>
31+
)
32+
);
33+
TooltipContent.displayName = 'TooltipContent';
34+
35+
// Commenting out the original implementation
36+
// const TooltipProvider = TooltipPrimitive.Provider;
37+
// const Tooltip = TooltipPrimitive.Root;
38+
// const TooltipTrigger = TooltipPrimitive.Trigger;
39+
// const TooltipContent = React.forwardRef<
40+
// React.ElementRef<typeof TooltipPrimitive.Content>,
41+
// React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
42+
// >(({ className, sideOffset = 4, ...props }, ref) => (
43+
// <TooltipPrimitive.Content
44+
// ref={ref}
45+
// sideOffset={sideOffset}
46+
// className={cn(
47+
// 'z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
48+
// className
49+
// )}
50+
// {...props}
51+
// />
52+
// ));
53+
// TooltipContent.displayName = TooltipPrimitive.Content.displayName;
2954

3055
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };

0 commit comments

Comments
 (0)