mirror of
https://github.com/mue/mue.git
synced 2026-07-18 06:24:17 +02:00
feat: add opt-in umami analytics (WIP)
This commit is contained in:
@@ -21,6 +21,8 @@ export default class Checkbox extends React.PureComponent {
|
||||
checked: (this.state.checked === true) ? false : true
|
||||
});
|
||||
|
||||
window.analytics.postEvent('settingUpdate', `${(this.state.checked === true) ? 'Enabled' : 'Disabled'} setting ${this.props.name}`);
|
||||
|
||||
if (this.props.element) {
|
||||
if (!document.querySelector(this.props.element)) {
|
||||
document.querySelector('.reminder-info').style.display = 'block';
|
||||
|
||||
@@ -22,6 +22,8 @@ export default class Dropdown extends React.PureComponent {
|
||||
return;
|
||||
}
|
||||
|
||||
window.analytics.postEvent('settingUpdate', `Changed setting ${this.props.name} from ${this.state.value} to ${value}`);
|
||||
|
||||
this.setState({
|
||||
value: value,
|
||||
title: e.target[e.target.selectedIndex].text
|
||||
|
||||
@@ -29,6 +29,8 @@ export default class Radio extends React.PureComponent {
|
||||
value: value
|
||||
});
|
||||
|
||||
window.analytics.postEvent('settingUpdate', `Changed setting ${this.props.name} from ${this.state.value} to ${value}`);
|
||||
|
||||
if (this.props.element) {
|
||||
if (!document.querySelector(this.props.element)) {
|
||||
document.querySelector('.reminder-info').style.display = 'block';
|
||||
|
||||
@@ -19,6 +19,8 @@ export default class Slider extends React.PureComponent {
|
||||
handleChange = (e, text) => {
|
||||
let { value } = e.target;
|
||||
|
||||
window.analytics.postEvent('settingUpdate', `Changed setting ${this.props.name} from ${this.state.value} to ${value}`);
|
||||
|
||||
if (text) {
|
||||
if (value === '') {
|
||||
return this.setState({
|
||||
|
||||
@@ -21,6 +21,8 @@ export default class Switch extends React.PureComponent {
|
||||
checked: (this.state.checked === true) ? false : true
|
||||
});
|
||||
|
||||
window.analytics.postEvent('settingUpdate', `${(this.state.checked === true) ? 'Enabled' : 'Disabled'} setting ${this.props.name}`);
|
||||
|
||||
if (this.props.element) {
|
||||
if (!document.querySelector(this.props.element)) {
|
||||
document.querySelector('.reminder-info').style.display = 'block';
|
||||
|
||||
Reference in New Issue
Block a user