Skip to content

Commit

Permalink
small bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mareksubocz committed Jan 25, 2021
1 parent 5c89cfe commit 83ed87b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
2 changes: 1 addition & 1 deletion frontend/.eslintcache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"/Users/mareksubocz/it/OMR/frontend/src/Main.js":"1","/Users/mareksubocz/it/OMR/frontend/src/DropzoneAreaExample.js":"2","/Users/mareksubocz/it/OMR/frontend/src/index.js":"3","/Users/mareksubocz/it/OMR/frontend/src/Loading.js":"4"},{"size":3642,"mtime":1611541911508,"results":"5","hashOfConfig":"6"},{"size":631,"mtime":1611541539806,"results":"7","hashOfConfig":"6"},{"size":741,"mtime":1611531416020,"results":"8","hashOfConfig":"6"},{"size":198,"mtime":1611528375363,"results":"9","hashOfConfig":"6"},{"filePath":"10","messages":"11","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"12"},"1sujrws",{"filePath":"13","messages":"14","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"15","messages":"16","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"17","messages":"18","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"19"},"/Users/mareksubocz/it/OMR/frontend/src/Main.js",["20"],"import React, {useState} from \"react\";\nimport DropzoneAreaExample from './DropzoneAreaExample';\nimport Button from '@material-ui/core/Button';\nimport Paper from '@material-ui/core/Paper';\nimport CssBaseline from '@material-ui/core/CssBaseline';\nimport Loader from 'react-loader-spinner'\nimport SplitPane from 'react-split-pane';\nimport XMLLogo from './img/MusicXMLlogo.png'\nimport MIDILogo from './img/MIDILogo.png'\nimport axios from 'axios'\n\n\nfunction Main(){\n var [image, setImage] = useState();\n var [loading, setLoading] = useState(false);\n var [ready, setReady] = useState(false);\n\n function handleButton(){\n if(image === undefined || !image.length){\n alert(\"Please provide an image first!\")\n return\n }\n // TODO: Rzucamy POST\n setLoading(true)\n setReady(false)\n // TODO: Ładujemy GET\n setLoading(false)\n setReady(true)\n }\n\n function handleDropzoneChange(file){\n setImage(file)\n }\n function handleDropzoneDelete(){\n setImage(undefined)\n }\n\n return (\n <div className=\"root\">\n <CssBaseline/>\n <SplitPane split=\"vertical\" minSize=\"50%\" className=\"splitpane\">\n <div className=\"lewa\">\n <Paper className=\"paper\" elevation={3} square={true}>\n <DropzoneAreaExample \n handleDelete={handleDropzoneDelete} \n handleChange={handleDropzoneChange}\n />\n <div className=\"submit\">\n <Button\n type=\"submit\"\n fullWidth\n variant=\"contained\"\n color=\"primary\"\n onClick={() => { handleButton() }}\n >\n Analyze\n </Button>\n </div>\n </Paper>\n </div>\n <div className=\"prawa\">\n <Loader \n style={{display: loading ? '': 'none'}}\n type=\"TailSpin\" \n color=\"white\" \n width=\"100\"\n height=\"100\"\n className=\"loader\"\n />\n <div className=\"przyciski\">\n <a download href=\"./data/Carol_of_the_Bells.mxl\">\n <Button>\n <div style={{display: ready ? 'flex': 'none'}} \n className=\"downloadButton\"\n >\n <img src={XMLLogo} alt=\"logo\" className=\"logo\"/>\n DOWNLOAD MusicXML\n </div>\n </Button>\n </a>\n <a download href=\"./data/Carol_of_the_Bells.mid\">\n <Button>\n <div style={{display: ready ? 'flex': 'none'}} \n className=\"downloadButton\"\n >\n <img src={MIDILogo} alt=\"logo\" className=\"logo\"/>\n DOWNLOAD MIDI\n </div>\n </Button>\n </a>\n </div>\n </div>\n </SplitPane>\n </div>\n );\n}\n \nexport default Main\n","/Users/mareksubocz/it/OMR/frontend/src/DropzoneAreaExample.js",[],"/Users/mareksubocz/it/OMR/frontend/src/index.js",["21"],"/Users/mareksubocz/it/OMR/frontend/src/Loading.js",["22"],"import React, {useState} from \"react\";\n\nfunction Loading(){\n return (\n <div>\n <h1> Siemka! </h1>\n Sialalalkdjfklasj\n </div>\n );\n\n}\n \nexport default Loading\n",{"ruleId":"23","severity":1,"message":"24","line":10,"column":8,"nodeType":"25","messageId":"26","endLine":10,"endColumn":13},{"ruleId":"23","severity":1,"message":"27","line":10,"column":5,"nodeType":"25","messageId":"26","endLine":10,"endColumn":9},{"ruleId":"23","severity":1,"message":"28","line":1,"column":16,"nodeType":"25","messageId":"26","endLine":1,"endColumn":24},"no-unused-vars","'axios' is defined but never used.","Identifier","unusedVar","'Link' is defined but never used.","'useState' is defined but never used."]
[{"/Users/mareksubocz/it/OMR/frontend/src/Main.js":"1","/Users/mareksubocz/it/OMR/frontend/src/DropzoneAreaExample.js":"2","/Users/mareksubocz/it/OMR/frontend/src/index.js":"3"},{"size":3642,"mtime":1611541911508,"results":"4","hashOfConfig":"5"},{"size":631,"mtime":1611541539806,"results":"6","hashOfConfig":"5"},{"size":207,"mtime":1611542186501,"results":"7","hashOfConfig":"5"},{"filePath":"8","messages":"9","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"10"},"1sujrws",{"filePath":"11","messages":"12","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"13","messages":"14","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/mareksubocz/it/OMR/frontend/src/Main.js",["15"],"import React, {useState} from \"react\";\nimport DropzoneAreaExample from './DropzoneAreaExample';\nimport Button from '@material-ui/core/Button';\nimport Paper from '@material-ui/core/Paper';\nimport CssBaseline from '@material-ui/core/CssBaseline';\nimport Loader from 'react-loader-spinner'\nimport SplitPane from 'react-split-pane';\nimport XMLLogo from './img/MusicXMLlogo.png'\nimport MIDILogo from './img/MIDILogo.png'\nimport axios from 'axios'\n\n\nfunction Main(){\n var [image, setImage] = useState();\n var [loading, setLoading] = useState(false);\n var [ready, setReady] = useState(false);\n\n function handleButton(){\n if(image === undefined || !image.length){\n alert(\"Please provide an image first!\")\n return\n }\n // TODO: Rzucamy POST\n setLoading(true)\n setReady(false)\n // TODO: Ładujemy GET\n setLoading(false)\n setReady(true)\n }\n\n function handleDropzoneChange(file){\n setImage(file)\n }\n function handleDropzoneDelete(){\n setImage(undefined)\n }\n\n return (\n <div className=\"root\">\n <CssBaseline/>\n <SplitPane split=\"vertical\" minSize=\"50%\" className=\"splitpane\">\n <div className=\"lewa\">\n <Paper className=\"paper\" elevation={3} square={true}>\n <DropzoneAreaExample \n handleDelete={handleDropzoneDelete} \n handleChange={handleDropzoneChange}\n />\n <div className=\"submit\">\n <Button\n type=\"submit\"\n fullWidth\n variant=\"contained\"\n color=\"primary\"\n onClick={() => { handleButton() }}\n >\n Analyze\n </Button>\n </div>\n </Paper>\n </div>\n <div className=\"prawa\">\n <Loader \n style={{display: loading ? '': 'none'}}\n type=\"TailSpin\" \n color=\"white\" \n width=\"100\"\n height=\"100\"\n className=\"loader\"\n />\n <div className=\"przyciski\">\n <a download href=\"./data/Carol_of_the_Bells.mxl\">\n <Button>\n <div style={{display: ready ? 'flex': 'none'}} \n className=\"downloadButton\"\n >\n <img src={XMLLogo} alt=\"logo\" className=\"logo\"/>\n DOWNLOAD MusicXML\n </div>\n </Button>\n </a>\n <a download href=\"./data/Carol_of_the_Bells.mid\">\n <Button>\n <div style={{display: ready ? 'flex': 'none'}} \n className=\"downloadButton\"\n >\n <img src={MIDILogo} alt=\"logo\" className=\"logo\"/>\n DOWNLOAD MIDI\n </div>\n </Button>\n </a>\n </div>\n </div>\n </SplitPane>\n </div>\n );\n}\n \nexport default Main\n","/Users/mareksubocz/it/OMR/frontend/src/DropzoneAreaExample.js",[],"/Users/mareksubocz/it/OMR/frontend/src/index.js",[],{"ruleId":"16","severity":1,"message":"17","line":10,"column":8,"nodeType":"18","messageId":"19","endLine":10,"endColumn":13},"no-unused-vars","'axios' is defined but never used.","Identifier","unusedVar"]
20 changes: 1 addition & 19 deletions frontend/src/index.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,12 @@
import React from "react"
import ReactDOM from "react-dom"
import Main from "./Main"
import Loading from "./Loading"
import './style.css'
import {
BrowserRouter as Router,
Switch,
Route,
Link,
} from "react-router-dom";

// JSX
ReactDOM.render(
<div>
<Router>
<Switch>
<Route path="/loading" component = {Loading}/>
<Route exact path="/" component = {Main}/>
</Switch>
{/* <Link to="/loading"> Loading </Link> */}
{/* <Link to="/"> Main </Link> */}
</Router>
{/* <Main/> */}
<Main/>
</div>,
document.getElementById("root")
)

var myNewP = document.createElement("p")
myNewP.innerHTML = "This is a paragraph."

0 comments on commit 83ed87b

Please sign in to comment.