Skip to content

Commit 05f684b

Browse files
committed
1.1.7 - NextJS 15.3.5, fixes issues with the build, 15.5.3 does not support some of our SSR ready dropdowns, etc
1 parent 59bf26c commit 05f684b

File tree

4 files changed

+64
-22
lines changed

4 files changed

+64
-22
lines changed

app/page.tsx

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,15 +243,17 @@ export default async function Page(props) {
243243
<br />
244244
<br />
245245
<Card title="EXAMPLE">
246-
<Avatar src="https://pbs.twimg.com/profile_images/1934755236364865537/OxJve4Jp_400x400.jpg" href="https://internet.dev" target="_blank" />
247-
<Avatar src="https://pbs.twimg.com/profile_images/1925213285663805441/fUiKWlj2_400x400.jpg" href="https://internet.dev" target="_blank" />
248-
<Avatar src="https://pbs.twimg.com/profile_images/1890125319224598528/ZILr9OGp_400x400.jpg" href="https://internet.dev" target="_blank" />
246+
<Avatar src="https://pbs.twimg.com/profile_images/1958569334726668288/GFE8mhKI_400x400.jpg" href="https://internet.dev" target="_blank" />
249247
<Avatar src="https://pbs.twimg.com/profile_images/1748647089633169408/B7vd7ito_400x400.jpg" href="https://internet.dev" target="_blank" />
250-
<Avatar src="https://pbs.twimg.com/profile_images/1841883108305731585/3rhRm7aY_400x400.jpg" href="https://internet.dev" target="_blank" />
248+
<Avatar src="https://pbs.twimg.com/profile_images/1890125319224598528/ZILr9OGp_400x400.jpg" href="https://internet.dev" target="_blank" />
249+
<Avatar src="https://pbs.twimg.com/profile_images/1919579065444663300/cxCRW91y_400x400.jpg" href="https://internet.dev" target="_blank" />
250+
251251
<Avatar src="https://avatars.githubusercontent.com/u/10610892?v=4" href="https://internet.dev" target="_blank" />
252+
<Avatar src="https://pbs.twimg.com/profile_images/1947754354368536576/Jc96WEuk_400x400.jpg" href="https://internet.dev" target="_blank" />
253+
<Avatar src="https://pbs.twimg.com/profile_images/1925213285663805441/fUiKWlj2_400x400.jpg" href="https://internet.dev" target="_blank" />
252254
<br />
253255
<br />
254-
<Avatar src="https://pbs.twimg.com/profile_images/1934755236364865537/OxJve4Jp_400x400.jpg" href="https://x.com/aalimbuyuguen" target="_blank">
256+
<Avatar src="https://pbs.twimg.com/profile_images/1958569334726668288/GFE8mhKI_400x400.jpg" href="https://x.com/aalimbuyuguen" target="_blank">
255257
<Indent>
256258
ANDREW ALIMBUYUGUEN
257259
<br />
@@ -286,6 +288,13 @@ export default async function Page(props) {
286288
Webmaster
287289
</Indent>
288290
</Avatar>
291+
<Avatar src="https://pbs.twimg.com/profile_images/1947754354368536576/Jc96WEuk_400x400.jpg" href="https://x.com/hellohsuh" target="_blank">
292+
<Indent>
293+
HANNAH SUH
294+
<br />
295+
Webmaster
296+
</Indent>
297+
</Avatar>
289298
<Avatar src="https://pbs.twimg.com/profile_images/1925213285663805441/fUiKWlj2_400x400.jpg" href="https://x.com/wwwjim" target="_blank">
290299
<Indent>
291300
JIMMY LEE

components/ModalStack.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ const ModalStack: React.FC<ModalStackProps> = () => {
1818
{modalStack.map((modalState, index) => {
1919
const { key, component: ModalComponent, props } = modalState;
2020

21+
if (!ModalComponent) {
22+
console.warn(`ModalComponent is undefined for modal with key: ${key}`);
23+
return null;
24+
}
25+
2126
const offsetFromLast = totalModals - 1 - index;
2227
const translateY = -offsetFromLast * 40;
2328
const blur = offsetFromLast * 1.1;

components/page/ModalContext.tsx

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,17 @@ export const ModalProvider: React.FC<{ children: React.ReactNode }> = ({ childre
2020
const [modalStack, setModalStack] = React.useState<ModalState<any>[]>([]);
2121

2222
const open = <P,>(component: ModalComponent<P>, props: P): string => {
23-
const key = `modal-${Date.now()}-${Math.random()}`;
23+
if (!component) {
24+
console.warn('Modal component is required - modal will not open');
25+
return '';
26+
}
27+
28+
if (typeof component !== 'function' && typeof component !== 'object') {
29+
console.warn('Modal component must be a valid React component - modal will not open');
30+
return '';
31+
}
32+
33+
const key = `modal-${Date.now()}-${Math.random().toString(36).substring(2, 11)}`;
2434

2535
const newModal: ModalState<P> = { key, component, props };
2636

@@ -30,22 +40,40 @@ export const ModalProvider: React.FC<{ children: React.ReactNode }> = ({ childre
3040
};
3141

3242
const close = (key?: string): void => {
33-
setModalStack((prev) =>
34-
key ? prev.filter((modal) => modal.key !== key) : prev.slice(0, -1)
35-
);
43+
setModalStack((prev) => {
44+
if (prev.length === 0) {
45+
return prev;
46+
}
47+
48+
if (key) {
49+
if (typeof key !== 'string') {
50+
console.warn('Modal key must be a string');
51+
return prev;
52+
}
53+
return prev.filter((modal) => modal.key !== key);
54+
}
55+
56+
return prev.slice(0, -1);
57+
});
3658
};
3759

38-
return (
39-
<ModalContext.Provider value={{ modalStack, open, close }}>
40-
{children}
41-
</ModalContext.Provider>
42-
);
60+
return <ModalContext.Provider value={{ modalStack, open, close }}>{children}</ModalContext.Provider>;
4361
};
4462

4563
export const useModals = (): ModalContextType => {
4664
const context = React.useContext(ModalContext);
4765
if (!context) {
48-
throw new Error('useModals must be used within a ModalProvider and use client');
66+
console.warn('useModals must be used within a ModalProvider');
67+
return {
68+
modalStack: [],
69+
open: () => {
70+
console.warn('Modal open called outside of ModalProvider - modal will not open');
71+
return '';
72+
},
73+
close: () => {
74+
console.warn('Modal close called outside of ModalProvider - modal will not close');
75+
}
76+
};
4977
}
5078
return context;
51-
};
79+
};

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@
55
"node": ">=18"
66
},
77
"license": "MIT",
8-
"version": "1.1.6",
8+
"version": "1.1.7",
99
"scripts": {
1010
"dev": "next -p 10000",
1111
"build": "next build",
1212
"start": "PORT=10000 next start",
1313
"lint": "next lint"
1414
},
1515
"dependencies": {
16-
"next": "^15.3.3",
16+
"next": "15.3.5",
1717
"react": "^19.1.0",
1818
"react-dom": "^19.1.0",
19-
"sass": "1.89.0"
19+
"sass": "1.92.1"
2020
},
2121
"devDependencies": {
22-
"@types/node": "^22.15.28",
23-
"@types/react": "^19.1.6",
22+
"@types/node": "^24.5.1",
23+
"@types/react": "^19.1.13",
2424
"ts-node": "^10.9.2",
25-
"typescript": "^5.8.3"
25+
"typescript": "^5.9.2"
2626
}
2727
}

0 commit comments

Comments
 (0)