Skip to content

Commit

Permalink
warning for non-chrome browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
colinmorris committed Mar 13, 2017
1 parent a2e7369 commit 3a8b0e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"dependencies": {
"bootstrap": "^3.3.7",
"clipboard": "^1.6.1",
"detect-browser": "^1.6.2",
"file-saver": "^1.3.3",
"firebase": "^3.6.10",
"gh-pages": "^0.12.0",
Expand Down
9 changes: 9 additions & 0 deletions src/Songsim.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ResizableBox } from 'react-resizable';
import { saveAs } from 'file-saver';
import JSZip from 'jszip';
import { hashHistory } from 'react-router';
import browser from 'detect-browser';

import './Songsim.css';

Expand Down Expand Up @@ -283,6 +284,12 @@ class Songsim extends Component {
this.setState(state);
}

renderBrowserWarning() {
if (browser.name && browser.name !== 'chrome') {
return (<p className="bg-danger"><b>Warning:</b> This site runs best on Chrome. It may run slowly on other browsers, or not at all.</p>);
}
}

render() {
// TODO: this method is getting pretty huge
var rowcols = this.focal_rowcols;
Expand Down Expand Up @@ -398,6 +405,7 @@ class Songsim extends Component {
<div className="container">
{toolbox}
</div>
{this.renderBrowserWarning()}
{debug}
</div>
);
Expand Down Expand Up @@ -437,6 +445,7 @@ class Songsim extends Component {
</p>
</div>
}
{this.renderBrowserWarning()}

</div>
)
Expand Down

0 comments on commit 3a8b0e1

Please sign in to comment.