File tree 1 file changed +11
-0
lines changed
src/app/components/shell/lower-sticky-note
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import { usePutAway , useStickyData } from '../shared.js' ;
3
+ import { useLocation } from 'react-router-dom' ;
3
4
import JITLoad from '~/helpers/jit-load' ;
4
5
6
+ function useIsTemporarilyBanned ( ) {
7
+ const { pathname} = useLocation ( ) ;
8
+ const econBanUntil = new Date ( '2024-05-16' ) . valueOf ( ) ;
9
+ const inBanPeriod = Date . now ( ) . valueOf ( ) < econBanUntil ;
10
+
11
+ return ( ( / p r i n c .* e c o n .* / ) . test ( pathname ) && inBanPeriod ) ;
12
+ }
13
+
5
14
export default function LowerStickyNote ( ) {
6
15
const stickyData = useStickyData ( ) ;
7
16
const [ closed , PutAway ] = usePutAway ( ) ;
17
+ const isTemporarilyBanned = useIsTemporarilyBanned ( ) ;
8
18
const shouldNotDisplay = ! stickyData || closed ||
19
+ isTemporarilyBanned ||
9
20
stickyData . mode !== 'banner' ;
10
21
11
22
if ( shouldNotDisplay ) {
You can’t perform that action at this time.
0 commit comments