diff options
Diffstat (limited to 'frontend/src')
-rw-r--r-- | frontend/src/App.css | 0 | ||||
-rw-r--r-- | frontend/src/App.js | 18 | ||||
-rw-r--r-- | frontend/src/App.test.js | 8 | ||||
-rw-r--r-- | frontend/src/SECAPIData.js | 47 | ||||
-rw-r--r-- | frontend/src/index.js | 16 | ||||
-rw-r--r-- | frontend/src/reportWebVitals.js | 13 | ||||
-rw-r--r-- | frontend/src/setupTests.js | 5 |
7 files changed, 107 insertions, 0 deletions
diff --git a/frontend/src/App.css b/frontend/src/App.css new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/frontend/src/App.css diff --git a/frontend/src/App.js b/frontend/src/App.js new file mode 100644 index 0000000..73ec59e --- /dev/null +++ b/frontend/src/App.js @@ -0,0 +1,18 @@ +import './App.css'; +import SECAPIData from "./SECAPIData"; + +/* +App is the main react component that contains all the other maps components +*/ + +function App() { + + return ( + <div className="App"> + <SECAPIData></SECAPIData> + </div> + ); +} + +export default App; + diff --git a/frontend/src/App.test.js b/frontend/src/App.test.js new file mode 100644 index 0000000..1f03afe --- /dev/null +++ b/frontend/src/App.test.js @@ -0,0 +1,8 @@ +import { render, screen } from '@testing-library/react'; +import App from './App'; + +test('renders learn react link', () => { + render(<App />); + const linkElement = screen.getByText(/learn react/i); + expect(linkElement).toBeInTheDocument(); +}); diff --git a/frontend/src/SECAPIData.js b/frontend/src/SECAPIData.js new file mode 100644 index 0000000..daa653a --- /dev/null +++ b/frontend/src/SECAPIData.js @@ -0,0 +1,47 @@ +import React, {useState, useRef} from 'react'; + + +function SECAPIData() { + + const [filedAt, setFiledAt] = useState(""); + const [xml, setXML] = useState(""); + + const requestData = () => { + + const toSend = { + filedAt : filedAt, + xml : xml, + }; + + let axiosConfig = { + headers: { + 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', + "Access-Control-Allow-Origin": "*", + } + }; + + axios({ + method: 'post', + url: 'http://localhost:4567/', + headers: axiosConfig, + data: toSend + }) + + .then(response => { + + }) + .catch(function (error) { + console.log(error); + }); + } + + return ( + <div> + <h1 >SECAPIData</h1> + <Button onPress={requestData}>GETDATA</Button> + </div> + ); +} + +export default SECAPIData; +
\ No newline at end of file diff --git a/frontend/src/index.js b/frontend/src/index.js new file mode 100644 index 0000000..7998135 --- /dev/null +++ b/frontend/src/index.js @@ -0,0 +1,16 @@ +import React from 'react'; +import ReactDOM from 'react-dom'; +import App from './App'; +import reportWebVitals from './reportWebVitals'; + +ReactDOM.render( + <React.StrictMode> + <App /> + </React.StrictMode>, + document.getElementById('root') +); + +// If you want to start measuring performance in your app, pass a function +// to log results (for example: reportWebVitals(console.log)) +// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals +reportWebVitals(); diff --git a/frontend/src/reportWebVitals.js b/frontend/src/reportWebVitals.js new file mode 100644 index 0000000..5253d3a --- /dev/null +++ b/frontend/src/reportWebVitals.js @@ -0,0 +1,13 @@ +const reportWebVitals = onPerfEntry => { + if (onPerfEntry && onPerfEntry instanceof Function) { + import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { + getCLS(onPerfEntry); + getFID(onPerfEntry); + getFCP(onPerfEntry); + getLCP(onPerfEntry); + getTTFB(onPerfEntry); + }); + } +}; + +export default reportWebVitals; diff --git a/frontend/src/setupTests.js b/frontend/src/setupTests.js new file mode 100644 index 0000000..8f2609b --- /dev/null +++ b/frontend/src/setupTests.js @@ -0,0 +1,5 @@ +// jest-dom adds custom jest matchers for asserting on DOM nodes. +// allows you to do things like: +// expect(element).toHaveTextContent(/react/i) +// learn more: https://github.com/testing-library/jest-dom +import '@testing-library/jest-dom'; |