File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 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';
3636import { CollectionSearchbar } from '../components/Searchbar' ;
3737import { getIsUserOwner } from '../selectors/users' ;
3838import RootPage from '../../../components/RootPage' ;
39+ import Notification from '../../User/components/Notification' ;
3940
4041function getTitle ( props ) {
4142 const { id } = props . project ;
@@ -252,6 +253,7 @@ class IDEView extends React.Component {
252253 render ( ) {
253254 return (
254255 < RootPage >
256+ < Notification />
255257 < Helmet >
256258 < title > { getTitle ( this . props ) } </ title >
257259 </ 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