1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-08-03 03:47:37 +02:00

add ui events

This commit is contained in:
Kushagra Gour
2019-03-15 15:11:33 +05:30
parent 698de288e0
commit e39e284705
7 changed files with 26 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
import { h, Component } from 'preact';
import { FileIcon } from './FileIcon';
import { getParentPath, getFileFromPath } from '../fileUtils';
import { trackEvent } from '../analytics';
const ENTER_KEY = 13;
const ESCAPE_KEY = 27;
@@ -119,9 +120,11 @@ function Folder(props) {
export class SidePane extends Component {
addFileButtonClickHandler() {
this.setState({ isAddingFile: true });
trackEvent('ui', 'fileAddBtnClick');
}
addFolderButtonClickHandler() {
this.setState({ isAddingFolder: true });
trackEvent('ui', 'folderAddBtnClick');
}
/**
* Checks if the passed filename already exists and if so, warns the user.
@@ -173,6 +176,7 @@ export class SidePane extends Component {
if (answer) {
this.props.onRemoveFile(file.path);
}
trackEvent('ui', 'fileRemoveBtnClick');
}
renameFile(e) {
// This gets called twice when enter is pressed, because blur also fires.
@@ -200,6 +204,7 @@ export class SidePane extends Component {
this.setState({
fileBeingRenamed: file
});
trackEvent('ui', 'fileRenameBtnClick');
}
dragOverHandler(e) {