@@ -11,8 +11,6 @@ import QueryJetpackModules from 'calypso/components/data/query-jetpack-modules';
1111import SectionNav from 'calypso/components/section-nav' ;
1212import NavItem from 'calypso/components/section-nav/item' ;
1313import NavTabs from 'calypso/components/section-nav/tabs' ;
14- import useNoticeVisibilityMutation from 'calypso/my-sites/stats/hooks/use-notice-visibility-mutation' ;
15- import { useNoticeVisibilityQuery } from 'calypso/my-sites/stats/hooks/use-notice-visibility-query' ;
1614import { canCurrentUser } from 'calypso/state/selectors/can-current-user' ;
1715import isGoogleMyBusinessLocationConnectedSelector from 'calypso/state/selectors/is-google-my-business-location-connected' ;
1816import isJetpackModuleActive from 'calypso/state/selectors/is-jetpack-module-active' ;
@@ -42,29 +40,6 @@ import './style.scss';
4240 * }} StatsNavItem
4341 */
4442
45- // Use HOC to wrap hooks of `react-query` for fetching the notice visibility state.
46- function withNoticeHook ( HookedComponent ) {
47- return function WrappedComponent ( props ) {
48- const { data : showSettingsTooltip , refetch : refetchNotices } = useNoticeVisibilityQuery (
49- props . siteId ,
50- 'traffic_page_settings'
51- ) ;
52-
53- const { mutateAsync : mutateNoticeVisbilityAsync } = useNoticeVisibilityMutation (
54- props . siteId ,
55- 'traffic_page_settings'
56- ) ;
57-
58- return (
59- < HookedComponent
60- { ...props }
61- showSettingsTooltip = { showSettingsTooltip }
62- refetchNotices = { refetchNotices }
63- mutateNoticeVisbilityAsync = { mutateNoticeVisbilityAsync }
64- />
65- ) ;
66- } ;
67- }
6843/**
6944 * @param { { navItems: StatsNavItem[], selectedItemName: keyof typeof allNavItems, isLegacy: boolean, interval: string, pathTemplate: string } } props
7045 */
@@ -166,7 +141,6 @@ class StatsNavigation extends Component {
166141 isLegacy : PropTypes . bool ,
167142 adminUrl : PropTypes . string ,
168143 showLock : PropTypes . bool ,
169- delayTooltipPresentation : PropTypes . bool ,
170144 } ;
171145
172146 isValidItem = ( item ) => {
@@ -271,25 +245,6 @@ class StatsNavigation extends Component {
271245 }
272246}
273247
274- function shouldDelayTooltipPresentation ( state , siteId ) {
275- // Check the 'created_at' time stamp.
276- // Can return null (Redux hydration?) which we'll treat as a delay.
277- const siteCreatedTimeStamp = getSiteOption ( state , siteId , 'created_at' ) ;
278- if ( siteCreatedTimeStamp === null ) {
279- return true ;
280- }
281-
282- // Check if the site is less than one week old.
283- const WEEK_IN_MILLISECONDS = 7 * 1000 * 3600 * 24 ;
284- const siteIsLessThanOneWeekOld =
285- new Date ( siteCreatedTimeStamp ) > new Date ( Date . now ( ) - WEEK_IN_MILLISECONDS ) ;
286- if ( siteIsLessThanOneWeekOld ) {
287- return true ;
288- }
289-
290- return false ;
291- }
292-
293248export default connect (
294249 ( state , { siteId, selectedItem } ) => {
295250 return {
@@ -307,8 +262,7 @@ export default connect(
307262 siteId,
308263 pageModuleToggles : getModuleToggles ( state , siteId , [ selectedItem ] ) ,
309264 adminUrl : getSiteAdminUrl ( state , siteId ) ,
310- delayTooltipPresentation : shouldDelayTooltipPresentation ( state , siteId ) ,
311265 } ;
312266 } ,
313267 { requestModuleToggles, updateModuleToggles }
314- ) ( localize ( withNoticeHook ( StatsNavigation ) ) ) ;
268+ ) ( localize ( StatsNavigation ) ) ;
0 commit comments