forked from mui/material-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[core] Upgrade the dev dependencies (mui#13016)
- Loading branch information
1 parent
b1068e2
commit a8522c5
Showing
5 changed files
with
396 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletions
16
docs/src/modules/components/GoogleTag.js → ...src/modules/components/GoogleAnalytics.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
import React from 'react'; | ||
|
||
class GoogleTag extends React.Component { | ||
googleTimer = null; | ||
class GoogleAnalytics extends React.Component { | ||
timer = null; | ||
|
||
componentDidMount() { | ||
if (process.env.NODE_ENV !== 'production') { | ||
return; | ||
} | ||
|
||
// Wait for the title to be updated. | ||
this.googleTimer = setTimeout(() => { | ||
window.ga('send', { | ||
hitType: 'pageview', | ||
this.timer = setTimeout(() => { | ||
window.ga('set', { | ||
page: window.location.pathname, | ||
}); | ||
}, 0); | ||
window.ga('send', { hitType: 'pageview' }); | ||
}); | ||
} | ||
|
||
componentWillUnmount() { | ||
clearTimeout(this.googleTimer); | ||
clearTimeout(this.timer); | ||
} | ||
|
||
render() { | ||
return null; | ||
} | ||
} | ||
|
||
export default GoogleTag; | ||
export default GoogleAnalytics; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.