File tree 2 files changed +24
-0
lines changed
2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ import Feedback from '../components/Feedback';
36
36
import { CollectionSearchbar } from '../components/Searchbar' ;
37
37
import { getIsUserOwner } from '../selectors/users' ;
38
38
import RootPage from '../../../components/RootPage' ;
39
+ import Notification from '../../User/components/Notification' ;
39
40
40
41
function getTitle ( props ) {
41
42
const { id } = props . project ;
@@ -252,6 +253,7 @@ class IDEView extends React.Component {
252
253
render ( ) {
253
254
return (
254
255
< RootPage >
256
+ < Notification />
255
257
< Helmet >
256
258
< title > { getTitle ( this . props ) } </ title >
257
259
</ Helmet >
Original file line number Diff line number Diff line change
1
+ import { useEffect } from 'react' ;
2
+ import Cookies from 'js-cookie' ;
3
+ import { useDispatch } from 'react-redux' ;
4
+ import { showToast , setToastText } from '../../IDE/actions/toast' ;
5
+
6
+ function Notification ( ) {
7
+ const dispatch = useDispatch ( ) ;
8
+ useEffect ( ( ) => {
9
+ const notification = Cookies . get ( 'p5-notification' ) ;
10
+ if ( ! notification ) {
11
+ // show the toast
12
+ dispatch ( showToast ( 30000 ) ) ;
13
+ const text = `There is a scheduled outage on Sunday, April 9 3AM - 5AM UTC.
14
+ The entire site will be down, so please plan accordingly.` ;
15
+ dispatch ( setToastText ( text ) ) ;
16
+ Cookies . set ( 'p5-notification' , true , { expires : 365 } ) ;
17
+ }
18
+ } ) ;
19
+ return null ;
20
+ }
21
+
22
+ export default Notification ;
You can’t perform that action at this time.
0 commit comments