Skip to content

Commit

Permalink
Workspace conf
Browse files Browse the repository at this point in the history
  • Loading branch information
maebert committed Feb 25, 2020
1 parent 055f0f4 commit cfe40b5
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ mdwa/build
npm-debug.log*
yarn-debug.log*
yarn-error.log*
*.sublime-workspace
10 changes: 10 additions & 0 deletions mdwa.sublime-project
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"folders":
[
{
"path": ".",
"folder_exclude_patterns": ["node_modules", "build", ".tmp"],
"file_exclude_patterns": ["*.jks"]
}
]
}
7 changes: 7 additions & 0 deletions src/components/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ export default class WritingApp extends React.Component {
};
}

componentDidMount() {
if (window.plausible) window.plausible('Editor')
}

startWriting() {
if (window.plausible) window.plausible('Start Writing')
this.setState({
run: true,
startTime: this.now(),
Expand Down Expand Up @@ -89,11 +94,13 @@ export default class WritingApp extends React.Component {
won: true,
run: false
})
if (window.plausible) window.plausible('Win')
}

fail() {
this.stopWriting();
this.setState({lost: true})
if (window.plausible) window.plausible('Fail')
}

reset(type, limit, hardcore) {
Expand Down
13 changes: 9 additions & 4 deletions src/components/Help.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ const renderQuote = ({ text, author, url }) => {
);
};

const Help = () => {
const quotes = [
export default class Help extends React.Component {
static quotes = [
{
text: "Sadistic [and] brutal.",
author: "WIRED",
Expand All @@ -40,6 +40,11 @@ const Help = () => {
}
];

componentDidMount() {
if (window.plausible) window.plausible('Help')
}

render() {
return (
<div className="Help">
<Link to="/" className="navButton backButton">
Expand Down Expand Up @@ -118,7 +123,7 @@ const Help = () => {
, and many, many other outlets. Here's what some people have to say:
</p>

{quotes.map(quote => renderQuote(quote))}
{Help.quotes.map(quote => renderQuote(quote))}

<h2>Who made this?</h2>
<p>
Expand Down Expand Up @@ -184,6 +189,6 @@ const Help = () => {
</div>
</div>
);
}
};

export default Help;
2 changes: 1 addition & 1 deletion src/components/MDWA.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Welcome from './Welcome';
import Help from './Help';
import WritingApp from './App';

import { HashRouter as Router, Route } from "react-router-dom";
import { BrowserRouter as Router, Route } from "react-router-dom";

const App = (props) => {
let params = new URLSearchParams(props.location.search);
Expand Down

0 comments on commit cfe40b5

Please sign in to comment.