Skip to content

Commit 27d0714

Browse files
committed
fix: category triggers change
1 parent e023b81 commit 27d0714

File tree

20 files changed

+470
-1142
lines changed

20 files changed

+470
-1142
lines changed

package-lock.json

Lines changed: 0 additions & 727 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client';
22

33
import React, { useEffect } from 'react';
4-
import { TooltipProvider } from './components/ui/radix-compatibility';
4+
import { TooltipProvider } from './components/ui/better-tooltip';
55

66
// Providers
77
import { AuthProvider } from './features/auth/AuthProvider';

src/components/modals/ShareEmailModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client';
22

33
import React, { useState } from 'react';
4-
import { Dialog, DialogContent, DialogDescription } from '../ui/radix-compatibility';
4+
import { SimpleDialog as Dialog, SimpleDialogContent as DialogContent, SimpleDialogDescription as DialogDescription } from '../ui/simple-dialog';
55
import { Button } from '../ui/button';
66
import { useEntries } from '../../features/statements/hooks/useEntries';
77
import { sendEmail } from '../../features/email/api/emailApi';

src/components/modals/UserDataModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { useAuth } from '../../features/auth/api/hooks';
66
import { Button } from '../ui/button';
77
import { Input } from '../ui/input';
88
import { Save, X, User, Mail, Award, Edit2, LogOut } from 'lucide-react';
9-
import { Tooltip, TooltipTrigger, TooltipContent } from '../ui/radix-compatibility';
9+
import { Tooltip, TooltipTrigger, TooltipContent } from '../ui/better-tooltip';
1010
import { validateEmail } from '../../lib/utils/validateEmail';
1111
import QuestionCounter from '../ui/questionCounter/QuestionCounter';
1212
import ProgressWithFeedback from '../ui/progress/ProgressWithFeedback';

src/components/ui/dialog.tsx

Lines changed: 0 additions & 138 deletions
This file was deleted.

src/components/ui/dropdown-menu.tsx

Lines changed: 0 additions & 65 deletions
This file was deleted.

src/components/ui/label.tsx

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/components/ui/popover.tsx

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/components/ui/simple-dialog.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import React, { useEffect } from 'react';
22
import { cn } from '@/lib/utils';
33

44
interface SimpleDialogProps {
5-
isOpen: boolean;
5+
isOpen?: boolean;
6+
open?: boolean;
67
onOpenChange: (isOpen: boolean) => void;
78
children: React.ReactNode;
89
className?: string;
@@ -134,13 +135,17 @@ const SimpleDialogTrigger: React.FC<SimpleDialogTriggerProps> = ({ children }) =
134135

135136
const SimpleDialog: React.FC<SimpleDialogProps> = ({
136137
isOpen,
138+
open,
137139
onOpenChange,
138140
children,
139141
className
140142
}) => {
143+
// Support both isOpen and open props for compatibility
144+
const isDialogOpen = open !== undefined ? open : isOpen !== undefined ? isOpen : false;
145+
141146
// Handle ESC key press
142147
useEffect(() => {
143-
if (!isOpen) return;
148+
if (!isDialogOpen) return;
144149

145150
const onKeyDown = (e: KeyboardEvent) => {
146151
if (e.key === 'Escape') {
@@ -150,14 +155,12 @@ const SimpleDialog: React.FC<SimpleDialogProps> = ({
150155

151156
window.addEventListener('keydown', onKeyDown);
152157
return () => window.removeEventListener('keydown', onKeyDown);
153-
}, [isOpen, onOpenChange]);
154-
155-
console.log('SimpleDialog rendering with isOpen:', isOpen);
158+
}, [isDialogOpen, onOpenChange]);
156159

157160
// Provide the dialog state to all children via context
158161
return (
159-
<SimpleDialogContext.Provider value={{ isOpen, onOpenChange }}>
160-
{isOpen ? (
162+
<SimpleDialogContext.Provider value={{ isOpen: isDialogOpen, onOpenChange }}>
163+
{isDialogOpen ? (
161164
<div className={cn('fixed inset-0 z-50', className)}>
162165
<SimpleDialogOverlay />
163166
{children}

0 commit comments

Comments
 (0)