Skip to content

Commit 981e2a0

Browse files
authored
Merge pull request #155 from oslabs-beta/dev
Dev
2 parents 52d6db6 + 40721a2 commit 981e2a0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

client/src/App.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ const App = () => {
2424
});
2525

2626
// Toast position state for responsive behavior
27-
const [toastPosition, setToastPosition] = useState('top-center');
27+
const [toastPosition, setToastPosition] = useState<
28+
'top-center' | 'bottom-right'
29+
>('top-center');
2830

2931
// ----------------------------------------------------------
3032
// * USEEFFECT for light/dark mode toggle
@@ -45,7 +47,11 @@ const App = () => {
4547
useEffect(() => {
4648
const mediaQuery = window.matchMedia('(min-width: 640px)');
4749

48-
const updateToastPosition = (e) => {
50+
interface MediaQueryEvent {
51+
matches: boolean;
52+
}
53+
54+
const updateToastPosition = (e: MediaQueryEvent) => {
4955
setToastPosition(e.matches ? 'bottom-right' : 'top-center');
5056
};
5157

0 commit comments

Comments
 (0)