Skip to content

Commit

Permalink
Autoformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
Graham42 committed Jun 30, 2017
1 parent 4e8cc2b commit a700739
Show file tree
Hide file tree
Showing 42 changed files with 1,027 additions and 1,181 deletions.
78 changes: 38 additions & 40 deletions app/scripts/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require("html!../index.html");
require("../styles/index.less");
require("font-awesome-webpack");

import React, {Component} from "react";
import React, { Component } from "react";
import PitchReadingView from "./views/pitch_reading_view";
import RhythmReadingView from "./views/rhythm_reading_view";
import PrivacyPolicyModal from "./views/privacy_policy_modal";
Expand All @@ -11,19 +11,17 @@ import PitchStatisticService from "./services/pitch_statistic_service.js";
import RhythmStatisticService from "./services/rhythm_statistic_service.js";
import AnalyticsService from "./services/analytics_service.js";
import AppFreezer from "./AppFreezer.js";
import { Nav, NavItem, Button, Input } from 'react-bootstrap';
import classNames from 'classnames';
import { Nav, NavItem, Button, Input } from "react-bootstrap";
import classNames from "classnames";

const pianoBackgroundJpg = require("file!../images/piano-background.jpg");


export default class App extends Component {

constructor(props, context) {
super(props, context);
this.state = {
activeGame: "pitch",
showPrivacyPolicy: false,
showPrivacyPolicy: false
};
}

Expand All @@ -32,7 +30,7 @@ export default class App extends Component {
activeGame: newGame
});

AnalyticsService.sendEvent('GameSelection', newGame);
AnalyticsService.sendEvent("GameSelection", newGame);
}

render() {
Expand All @@ -49,33 +47,38 @@ export default class App extends Component {
<div className="row center-xs">
<div className="col-xs">
<Nav
bsStyle="pills" activeKey={this.state.activeGame}
onSelect={this.selectGame.bind(this)}
className="inlineBlock">
<NavItem eventKey="pitch" className="modeNavItem">Pitch training</NavItem>
<NavItem eventKey="rhythm" className="modeNavItem">Rhythm training</NavItem>
bsStyle="pills"
activeKey={this.state.activeGame}
onSelect={this.selectGame.bind(this)}
className="inlineBlock"
>
<NavItem eventKey="pitch" className="modeNavItem">
Pitch training
</NavItem>
<NavItem eventKey="rhythm" className="modeNavItem">
Rhythm training
</NavItem>
</Nav>
</div>
</div>
</div>

<div className="gameContainer">
<PitchReadingView
statisticService={PitchStatisticService}
settings={appState.settings.pitchReading}
key="pitch_game"
isActive={this.state.activeGame === "pitch"}
statisticService={PitchStatisticService}
settings={appState.settings.pitchReading}
key="pitch_game"
isActive={this.state.activeGame === "pitch"}
/>
<RhythmReadingView
statisticService={RhythmStatisticService}
settings={appState.settings.rhythmReading}
key="rhythm_game"
isActive={this.state.activeGame !== "pitch"}
statisticService={RhythmStatisticService}
settings={appState.settings.rhythmReading}
key="rhythm_game"
isActive={this.state.activeGame !== "pitch"}
/>
</div>
</div>
<footer>

<div className="subscribe-follow-section row around-md">
<div className="col-md-4 col-xs-12 left">
<div className="row">
Expand All @@ -85,11 +88,8 @@ export default class App extends Component {
</div>
<div className="row">
<div className="col-md-12 col-xs-12">
<p>
Sheet Music Tutor is still under development.
Be first to find out when it gets updates.
</p>
</div>
<p>Sheet Music Tutor is still under development. Be first to find out when it gets updates.</p>
</div>
</div>
<NewsletterForm />
</div>
Expand All @@ -101,42 +101,40 @@ export default class App extends Component {
</div>
<div className="row">
<div className="col-md-12 col-xs-12">
<p>
Follow us on social media to stay up to date on new features or to give us feedback.
</p>
</div>
<p>Follow us on social media to stay up to date on new features or to give us feedback.</p>
</div>
</div>
<div className="row">
<div className="col-md-12 col-xs-12">
<a href="http://facebook.com/SheetMusicTutor" target="_blank" className="btn btn-primary">
<i className="fa fa-facebook"></i>
<i className="fa fa-facebook" />
</a>
<a href="http://twitter.com/SheetMusicTutor" target="_blank" className="btn btn-primary">
<i className="fa fa-twitter"></i>
<i className="fa fa-twitter" />
</a>
<a href="http://github.com/philippotto/piano-trainer" target="_blank" className="btn btn-primary">
<i className="fa fa-github"></i>
<i className="fa fa-github" />
</a>
</div>
</div>
</div>
</div>
Created and maintained by <a href="http://github.com/philippotto/">Philipp Otto</a>
&nbsp;|&nbsp;
<a href="#" onClick={()=>this.setState({ showPrivacyPolicy: true })}>
<a href="#" onClick={() => this.setState({ showPrivacyPolicy: true })}>
Privacy Policy
</a>
&nbsp;|&nbsp;
&copy; {(new Date()).getFullYear()}

<PrivacyPolicyModal show={this.state.showPrivacyPolicy} onHide={() => this.setState({showPrivacyPolicy : false})} />
&nbsp;|&nbsp; &copy; {new Date().getFullYear()}
<PrivacyPolicyModal
show={this.state.showPrivacyPolicy}
onHide={() => this.setState({ showPrivacyPolicy: false })}
/>
</footer>
</div>

);
}

componentDidMount() {
AppFreezer.on('update', () => this.forceUpdate());
AppFreezer.on("update", () => this.forceUpdate());
}
}
10 changes: 5 additions & 5 deletions app/scripts/AppFreezer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ let defaultSettings = {
accuracyGoal: 0.85,
timeGoal: 2000,
amount: 5,
newNotesShare: 0.6,
newNotesShare: 0.6
},
chordSizeRanges: {
treble: [1, 3],
bass: [1, 3],
bass: [1, 3]
},
keySignature: [7, 7],
useAccidentals: false,
midi: {
inputs: Freezer.createLeaf([]),
activeInputIndex: 0,
activeInputIndex: 0
}
},
rhythmReading: {
Expand All @@ -29,7 +29,7 @@ let defaultSettings = {
eighthNotes: true,
sixteenthNotes: false,
dottedNotes: false,
triplets: false,
triplets: false
}
};

Expand All @@ -44,7 +44,7 @@ const AppFreezer = new Freezer({
settings: defaultSettings
});

AppFreezer.on('update', () => {
AppFreezer.on("update", () => {
const settingsJson = JSON.stringify(AppFreezer.get().settings.toJS());
localStorage.setItem("SheetMusicTutor-settings", settingsJson);
});
Expand Down
7 changes: 2 additions & 5 deletions app/scripts/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import React from "react";
import {render} from "react-dom";
import { render } from "react-dom";
import App from "./App";

render(
<App />,
document.getElementById("root")
);
render(<App />, document.getElementById("root"));
8 changes: 4 additions & 4 deletions app/scripts/services/analytics_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ export default {
return;
}

ga('send', {
hitType: 'event',
ga("send", {
hitType: "event",
eventCategory,
eventAction,
eventValue,
eventValue
});
}
}
};
Loading

0 comments on commit a700739

Please sign in to comment.