Commit 8d3bd82 1 parent ca829ac commit 8d3bd82 Copy full SHA for 8d3bd82
File tree 4 files changed +86
-1
lines changed
4 files changed +86
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import './style/theme.scss';
7
7
import './App.scss' ;
8
8
9
9
import AppHeader from './component/AppHeader/AppHeader' ;
10
+ // import ChangelogModal from './component/ChangelogModal/ChangelogModal';
10
11
import SearchPage from './pages/SearchPage' ;
11
12
import CoursePage from './pages/CoursePage' ;
12
13
import ProfessorPage from './pages/ProfessorPage' ;
@@ -106,6 +107,7 @@ export default function App() {
106
107
< Route path = "*" element = { < ErrorPage /> } />
107
108
</ Routes >
108
109
</ div >
110
+ { /* <div className="changelog-modal">{<ChangelogModal />}</div> */ }
109
111
</ div >
110
112
</ ThemeContext . Provider >
111
113
</ Router >
Original file line number Diff line number Diff line change
1
+ .changelog-modal {
2
+ .modal-content {
3
+ border : none ;
4
+ background-color : var (--overlay2 );
5
+ padding : 4px 8px 8px ;
6
+ }
7
+
8
+ .modal-header {
9
+ align-items : center ;
10
+ border-bottom : none ;
11
+ padding-bottom : 0 ;
12
+ }
13
+
14
+ h2 {
15
+ margin-bottom : 0 ;
16
+ font-size : 1.8rem ;
17
+ font-weight : 600 ;
18
+ }
19
+
20
+ .modal-body {
21
+ font-size : 1.2rem ;
22
+ margin : 0 ;
23
+ }
24
+
25
+ .modal-img {
26
+ margin : 1rem ;
27
+ max-width : 70vw ;
28
+ max-height : 50vh ;
29
+ object-fit : contain ;
30
+ }
31
+
32
+ button .close {
33
+ font-size : 32px ;
34
+ }
35
+
36
+ @media only screen and (max-width : 800px ) {
37
+ .modal-img {
38
+ max-width : 90vw ;
39
+ max-height : 50vh ;
40
+ }
41
+ }
42
+ }
Original file line number Diff line number Diff line change
1
+ import { useEffect , useState } from 'react' ;
2
+ import './ChangelogModal.scss' ;
3
+ import Modal from 'react-bootstrap/Modal' ;
4
+
5
+ const DESCRIPTION = 'You can now view recently added features to the PeterPortal website, listed in this modal.' ;
6
+ const IMAGE_URL =
7
+ 'https://media.tenor.com/ufm_0t3ACEAAAAAM/ginger-cat-ginger-cat-eating-then-staring-at-the-camera.gif' ;
8
+ const LAST_UPDATED = '02/27/2024' ;
9
+
10
+ const ChangelogModal = ( ) => {
11
+ const [ showModal , setShowModal ] = useState ( false ) ;
12
+
13
+ useEffect ( ( ) => {
14
+ // display the changelog modal if it is the user's first time seeing it (tracked in local storage)
15
+ const lastSeen = localStorage . getItem ( 'changelogSeen' ) ;
16
+
17
+ if ( lastSeen !== LAST_UPDATED ) {
18
+ setShowModal ( true ) ;
19
+
20
+ // mark as seen so it is not displayed after seeing it once
21
+ localStorage . setItem ( 'changelogSeen' , LAST_UPDATED ) ;
22
+ }
23
+ } , [ ] ) ;
24
+
25
+ const closeModal = ( ) => {
26
+ setShowModal ( false ) ;
27
+ } ;
28
+
29
+ return (
30
+ < Modal className = "changelog-modal" show = { showModal } centered onHide = { closeModal } >
31
+ < Modal . Header closeButton >
32
+ < h2 > What's New - { new Date ( LAST_UPDATED ) . toLocaleString ( 'default' , { month : 'long' , year : 'numeric' } ) } </ h2 >
33
+ </ Modal . Header >
34
+
35
+ < p className = "modal-body" > { DESCRIPTION } </ p >
36
+ < img className = "modal-img" src = { IMAGE_URL } alt = "Screenshot or gif of new changes" />
37
+ </ Modal >
38
+ ) ;
39
+ } ;
40
+
41
+ export default ChangelogModal ;
Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ const AddCoursePopup: FC<AddCoursePopupProps> = () => {
121
121
) ;
122
122
} ) }
123
123
</ Form . Control >
124
- < Form . Control . Feedback type = "invalid" > Missing qurter </ Form . Control . Feedback >
124
+ < Form . Control . Feedback type = "invalid" > Missing quarter </ Form . Control . Feedback >
125
125
</ Form . Group >
126
126
) }
127
127
< div className = "d-flex justify-content-end" >
You can’t perform that action at this time.
0 commit comments