Skip to content

Commit 1b15abf

Browse files
committed
Add shutdown notice
1 parent 5fb511c commit 1b15abf

File tree

5 files changed

+58
-32
lines changed

5 files changed

+58
-32
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@
131131
"^src/(.*)$": "<rootDir>/src/$1"
132132
},
133133
"globals": {
134-
"ts-jest": {
135-
"tsconfig": {
136-
"jsx": "react"
137-
}
134+
"ts-jest": {
135+
"tsconfig": {
136+
"jsx": "react"
138137
}
138+
}
139139
}
140140
},
141141
"dependencies": {

src/components/link.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,22 @@ type IWrappedLinkProps = {
99
isExternal?: boolean;
1010
};
1111

12+
const onClick = (href: string) => {
13+
if (window.umami) {
14+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
15+
window.umami.track('click', {href});
16+
}
17+
};
18+
1219
const WrappedLink = observer((props: LinkProps & IWrappedLinkProps) => {
1320
const {href, isExternal, ...otherProps} = props;
1421

1522
if (href.includes(':') || isExternal) {
1623
// External link
1724
return (
18-
<ChakraLink {...props} isExternal>
25+
<ChakraLink {...props} isExternal onClick={() => {
26+
onClick(href);
27+
}}>
1928
<Wrap align='center'>
2029
<WrapItem>
2130
{props.children}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import {Button, AlertDialog, useDisclosure, AlertDialogOverlay, AlertDialogBody, AlertDialogContent, AlertDialogFooter, AlertDialogHeader} from '@chakra-ui/react';
2+
import {observer} from 'mobx-react-lite';
3+
import WrappedLink from './link';
4+
5+
export const ShutdownWarning = observer(() => {
6+
const {isOpen, onClose} = useDisclosure({defaultIsOpen: true});
7+
8+
return (
9+
<AlertDialog
10+
isOpen={isOpen}
11+
onClose={onClose}
12+
leastDestructiveRef={undefined}
13+
>
14+
<AlertDialogOverlay>
15+
<AlertDialogContent>
16+
<AlertDialogHeader fontSize='lg' fontWeight='bold'>
17+
Shutdown notice
18+
</AlertDialogHeader>
19+
20+
<AlertDialogBody>
21+
<p style={{marginBottom: '1rem'}}>
22+
I will be shutting down this website at the end of April 2025. Data from previous semester will still be available, but no new data will be added.
23+
</p>
24+
<p style={{marginBottom: '1rem'}}>
25+
I emailed the Dean of the College of Computing a few months ago to see if they would be interested in taking over this website. He was aware that many students use this but seemed uninterested in running it.
26+
</p>
27+
<p>
28+
If you want Michigan Tech Courses to stay active, please email <WrappedLink href='mailto:[email protected]' display='inline-block'>[email protected]</WrappedLink> and ask that they reconsider. You can also reach me at <WrappedLink href='mailto:[email protected]' display='inline-block'>[email protected]</WrappedLink>.
29+
</p>
30+
</AlertDialogBody>
31+
32+
<AlertDialogFooter>
33+
<Button onClick={onClose}>
34+
ok :(
35+
</Button>
36+
</AlertDialogFooter>
37+
</AlertDialogContent>
38+
</AlertDialogOverlay>
39+
</AlertDialog>
40+
);
41+
});

src/pages/_app.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import useRevalidation from 'src/lib/hooks/use-revalidation';
99
import {type CustomNextPage} from 'src/lib/types';
1010
import MobileDeviceWarning from 'src/components/mobile-device-warning';
1111
import theme from 'src/lib/theme';
12+
import {ShutdownWarning} from 'src/components/shutdown-warning';
1213

1314
// eslint-disable-next-line mobx/missing-observer
1415
const MyApp = ({Component, pageProps}: AppProps & {Component: CustomNextPage<any>}) => {
@@ -39,12 +40,7 @@ const MyApp = ({Component, pageProps}: AppProps & {Component: CustomNextPage<any
3940
<meta name='viewport' content='width=device-width, initial-scale=1.0'/>
4041

4142
<link rel='dns-prefetch' href={process.env.NEXT_PUBLIC_THUMBOR_ENDPOINT}/>
42-
43-
{
44-
process.env.NODE_ENV === 'production' && (
45-
<script async defer data-website-id='6d73d07c-c64e-41db-9db7-5688da4d5945' src='https://um.maxisom.me/script.js'/>
46-
)
47-
}
43+
<script async defer data-website-id='6d73d07c-c64e-41db-9db7-5688da4d5945' src='https://um.maxisom.me/script.js'/>
4844

4945
<link rel='apple-touch-icon' sizes='180x180' href='/images/favicon/apple-touch-icon.png'/>
5046
<link rel='icon' type='image/png' sizes='32x32' href='/images/favicon/favicon-32x32.png'/>
@@ -63,6 +59,7 @@ const MyApp = ({Component, pageProps}: AppProps & {Component: CustomNextPage<any
6359
<Navbar/>
6460

6561
<Component {...pageProps}/>
62+
<ShutdownWarning/>
6663
</Box>
6764
</StateProvider>
6865

src/pages/about.tsx

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -77,27 +77,6 @@ const AboutPage = observer(() => (
7777
<Image src={LightningGif} />
7878
</VStack>
7979
</HStack>
80-
81-
<Box h={8} />
82-
83-
<Text as='span'>
84-
It currently costs ~$9 / month to host this, so if you found it useful
85-
feel free to{' '}
86-
<WrappedLink
87-
href='https://github.com/sponsors/codetheweb/'
88-
display='inline-block'
89-
>
90-
sponsor me
91-
</WrappedLink>{' '}
92-
or{' '}
93-
<WrappedLink
94-
href='https://www.buymeacoffee.com/maxisom'
95-
display='inline-block'
96-
>
97-
buy me a coffee
98-
</WrappedLink>
99-
.
100-
</Text>
10180
</VStack>
10281

10382
<VStack align='flex-start'>

0 commit comments

Comments
 (0)