Skip to content

Commit 8484933

Browse files
committed
fix: added type to EventListener on handleMagicLinkVerified
1 parent c48414e commit 8484933

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

src/App.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,16 @@ const AppContent: React.FC = () => {
5252

5353
// Listen for magic link verification and ensure user email is saved to entries context
5454
useEffect(() => {
55-
const handleMagicLinkVerified = (event: any) => {
55+
interface MagicLinkVerifiedEvent extends CustomEvent {
56+
detail: {
57+
user: {
58+
email: string;
59+
[key: string]: unknown;
60+
};
61+
};
62+
}
63+
64+
const handleMagicLinkVerified = (event: MagicLinkVerifiedEvent) => {
5665
if (event.detail?.user?.email) {
5766
console.log(
5867
'App: Magic link verified with email:',
@@ -67,9 +76,9 @@ const AppContent: React.FC = () => {
6776
}
6877
};
6978

70-
window.addEventListener('magicLinkVerified', handleMagicLinkVerified);
79+
window.addEventListener('magicLinkVerified', handleMagicLinkVerified as EventListener);
7180
return () =>
72-
window.removeEventListener('magicLinkVerified', handleMagicLinkVerified);
81+
window.removeEventListener('magicLinkVerified', handleMagicLinkVerified as EventListener);
7382
}, []);
7483

7584
return (

src/components/ui/Button.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Slot } from './SimpleSlot';
33
import type { VariantProps } from 'class-variance-authority';
44

55
import { cn } from '@/lib/utils';
6-
import { buttonVariants } from './buttonVariants';
6+
import { buttonVariants } from './ButtonVariants';
77

88
export interface ButtonProps
99
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
@@ -26,4 +26,4 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
2626

2727
Button.displayName = 'Button';
2828

29-
export { Button, buttonVariants };
29+
export { Button };

src/features/wizard/components/SubjectTiles.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useMemo } from 'react';
2-
import { Button } from '../../../components/ui/button';
2+
import { Button } from '../../../components/ui/Button';
33
import descriptorsData from '../../../data/descriptors.json';
44
import type { SetQuestion, DescriptorsData } from '../../../types/entries';
55

0 commit comments

Comments
 (0)