diff options
Diffstat (limited to 'frontend/src')
-rw-r--r-- | frontend/src/App.js | 2 | ||||
-rw-r--r-- | frontend/src/Button.js | 9 | ||||
-rw-r--r-- | frontend/src/Main.css | 4 | ||||
-rw-r--r-- | frontend/src/components/Banner.css | 4 | ||||
-rw-r--r-- | frontend/src/components/Banner.js | 12 | ||||
-rw-r--r-- | frontend/src/components/Hub.js (renamed from frontend/src/Hub.js) | 0 | ||||
-rw-r--r-- | frontend/src/components/HubList.js (renamed from frontend/src/HubList.js) | 0 | ||||
-rw-r--r-- | frontend/src/components/HubMap.css | 3 | ||||
-rw-r--r-- | frontend/src/components/HubMap.js | 8 | ||||
-rw-r--r-- | frontend/src/components/SECAPIData.js | 43 | ||||
-rw-r--r-- | frontend/src/templates/Template.js | 10 |
11 files changed, 85 insertions, 10 deletions
diff --git a/frontend/src/App.js b/frontend/src/App.js index cf89bf0..4f9afc0 100644 --- a/frontend/src/App.js +++ b/frontend/src/App.js @@ -1,5 +1,5 @@ import './App.css'; -import SECAPIData from "./SECAPIData"; +import SECAPIData from "./components/SECAPIData"; function App() { diff --git a/frontend/src/Button.js b/frontend/src/Button.js deleted file mode 100644 index 9aba266..0000000 --- a/frontend/src/Button.js +++ /dev/null @@ -1,9 +0,0 @@ -import { AwesomeButton } from "react-awesome-button"; -import "react-awesome-button/dist/styles.css"; - - -function Button(props) { - return <AwesomeButton type="primary" onPress={props.onPress}>GET DATA</AwesomeButton>; -} - -export default Button;
\ No newline at end of file diff --git a/frontend/src/Main.css b/frontend/src/Main.css new file mode 100644 index 0000000..c5ab948 --- /dev/null +++ b/frontend/src/Main.css @@ -0,0 +1,4 @@ +:root { + --main-bg-color: #121212; + --primary-surface-color: #1F1B24; +}
\ No newline at end of file diff --git a/frontend/src/components/Banner.css b/frontend/src/components/Banner.css new file mode 100644 index 0000000..e5016b9 --- /dev/null +++ b/frontend/src/components/Banner.css @@ -0,0 +1,4 @@ +h1 { + background-color: var(--primary-surface-color); + min-width: 400px; +}
\ No newline at end of file diff --git a/frontend/src/components/Banner.js b/frontend/src/components/Banner.js new file mode 100644 index 0000000..27eb5e9 --- /dev/null +++ b/frontend/src/components/Banner.js @@ -0,0 +1,12 @@ +import '../App.css'; +import './Banner.css'; + +function Banner() { + return ( + <> + <h1>Welcome To Watchdogs...</h1> + </> + ); +} + +export default Banner;
\ No newline at end of file diff --git a/frontend/src/Hub.js b/frontend/src/components/Hub.js index 6dbcc57..6dbcc57 100644 --- a/frontend/src/Hub.js +++ b/frontend/src/components/Hub.js diff --git a/frontend/src/HubList.js b/frontend/src/components/HubList.js index 64dd131..64dd131 100644 --- a/frontend/src/HubList.js +++ b/frontend/src/components/HubList.js diff --git a/frontend/src/components/HubMap.css b/frontend/src/components/HubMap.css new file mode 100644 index 0000000..c23f81d --- /dev/null +++ b/frontend/src/components/HubMap.css @@ -0,0 +1,3 @@ +canvas { + background-color: var(--main-bg-color); +}
\ No newline at end of file diff --git a/frontend/src/components/HubMap.js b/frontend/src/components/HubMap.js new file mode 100644 index 0000000..1c4ae3d --- /dev/null +++ b/frontend/src/components/HubMap.js @@ -0,0 +1,8 @@ +import '../App.css'; +import './HubMap.css'; + +function HubMap(props) { + return <canvas></canvas>; +} + +export default HubMap;
\ No newline at end of file diff --git a/frontend/src/components/SECAPIData.js b/frontend/src/components/SECAPIData.js new file mode 100644 index 0000000..b0ad82d --- /dev/null +++ b/frontend/src/components/SECAPIData.js @@ -0,0 +1,43 @@ +import React, {useState, useEffect} from 'react'; +import Button from './Button'; +import HubList from './HubList'; +import HubMap from './HubList'; +import './App.css'; +import Banner from './Banner'; + + + +function SECAPIData() { + const [displayData, setDisplayData] = useState({}); + + const sendToBackend = () => { + console.log(dataToBackend); + + fetch("http://localhost:4567/data", { + method: "POST", + body: JSON.stringify({ + "data" : dataToBackend + }), + headers: { + "Content-Type": "application/json", + }, + credentials: "same-origin" + }) + + .then(response => response.json().then(data => setDisplayData(data))) + .catch(error => console.log(error)); + } + + useEffect(() => sendToBackend(), []); + + return ( + <div className="mainGrid"> + <Banner></Banner> + <HubList data={displayData}></HubList> + <HubMap></HubMap> + </div> + ); +} + +export default SECAPIData; +
\ No newline at end of file diff --git a/frontend/src/templates/Template.js b/frontend/src/templates/Template.js new file mode 100644 index 0000000..c00e67e --- /dev/null +++ b/frontend/src/templates/Template.js @@ -0,0 +1,10 @@ +import '../App.css'; + +function Template(props) { + return ( + <> + </> + ); +} + +export default Template;
\ No newline at end of file |