Commit ed01de8
committed
fix(Map): use properly typed optional theme context
Fixes TypeScript errors by properly importing and typing ThemeContext for optional theme support.
Changes:
- Import ThemeContext and ThemeContextValue types directly
- Use React.useContext(ThemeContext) with proper typing
- Optional theme context with null check
- Fallback to 'var(--ai-color-brand-primary)' if theme unavailable
- Changed fallback from '#e4002b' to CSS variable for generic library
TypeScript Fixes:
- Properly typed themeContext: ThemeContextValue | null
- No more TS2339 errors on brandColors/theme properties
- Removed unused useThemeContext import
Result: MapContent works with or without ThemeProvider, fully typed and error-free.1 parent 279b97a commit ed01de8
1 file changed
+7
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
223 | 224 | | |
224 | 225 | | |
225 | 226 | | |
226 | | - | |
227 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
228 | 231 | | |
229 | 232 | | |
230 | 233 | | |
231 | 234 | | |
232 | | - | |
| 235 | + | |
233 | 236 | | |
234 | 237 | | |
235 | 238 | | |
| |||
0 commit comments