This repository has been archived by the owner on Oct 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
24,572 additions
and
3,337 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
import { Info } from '../Info/Info' | ||
import { Form } from '../Form/Form' | ||
import { Graph } from '../Graph/Graph' | ||
|
||
function Content(props) { | ||
const currentView = ({view}) => { | ||
if(view === 'Info') | ||
return <Info />; | ||
if(view === 'Home') | ||
return <Form />; | ||
if(view === 'Graph') | ||
return <Graph />; | ||
} | ||
|
||
return ( | ||
<div className="w-60"> | ||
{currentView(props)} | ||
</div> | ||
) | ||
|
||
} | ||
export { Content }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from 'react'; | ||
|
||
async function fetchData(host) { | ||
const headers = new Headers({ | ||
'Access-Control-Allow-Origin': host | ||
}); | ||
|
||
const init = { | ||
method: 'GET', | ||
headers: headers, | ||
mode: 'cors' | ||
}; | ||
|
||
const response = await fetch(host,init); | ||
|
||
if(!response.ok) { | ||
const message = `An error has occured: ${response.status}`; | ||
throw new Error(message); | ||
} | ||
|
||
const data = await response.json(); | ||
|
||
return data; | ||
} | ||
|
||
function Graph(){ | ||
return ( | ||
<p> | ||
Graph is work! | ||
</p> | ||
) | ||
} | ||
|
||
export { Graph }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.