Skip to content

Commit 4820520

Browse files
arbrandesclaude
andcommitted
fix: type GlobalDataContext to fix build
Convert GlobalDataContext.jsx to .tsx with proper interface so setEmailConfirmation and setPlatformSettings are typed as Dispatch<SetStateAction<T>> | null instead of literal null. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 43737be commit 4820520

2 files changed

Lines changed: 31 additions & 15 deletions

File tree

src/data/contexts/GlobalDataContext.jsx

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { createContext, Dispatch, SetStateAction } from 'react';
2+
3+
interface EmailConfirmation {
4+
isNeeded: boolean,
5+
sendEmailUrl: string,
6+
}
7+
8+
interface PlatformSettings {
9+
courseSearchUrl: string,
10+
}
11+
12+
interface GlobalDataContextType {
13+
emailConfirmation: EmailConfirmation,
14+
platformSettings: PlatformSettings,
15+
setEmailConfirmation: Dispatch<SetStateAction<EmailConfirmation>> | null,
16+
setPlatformSettings: Dispatch<SetStateAction<PlatformSettings>> | null,
17+
}
18+
19+
const GlobalDataContext = createContext<GlobalDataContextType>({
20+
emailConfirmation: {
21+
isNeeded: false,
22+
sendEmailUrl: '',
23+
},
24+
platformSettings: {
25+
courseSearchUrl: '',
26+
},
27+
setEmailConfirmation: null,
28+
setPlatformSettings: null,
29+
});
30+
31+
export default GlobalDataContext;

0 commit comments

Comments
 (0)