diff --git a/dashboard-client/app/app/src/App.css b/dashboard-client/app/app/src/App.css deleted file mode 100644 index 92f956e804..0000000000 --- a/dashboard-client/app/app/src/App.css +++ /dev/null @@ -1,32 +0,0 @@ -.App { - text-align: center; -} - -.App-logo { - animation: App-logo-spin infinite 20s linear; - height: 40vmin; -} - -.App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; -} - -.App-link { - color: #61dafb; -} - -@keyframes App-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} diff --git a/dashboard-client/app/app/src/App.js b/dashboard-client/app/app/src/App.js index 7e261ca47e..04ed341f2b 100644 --- a/dashboard-client/app/app/src/App.js +++ b/dashboard-client/app/app/src/App.js @@ -1,26 +1,51 @@ import React, { Component } from 'react'; -import logo from './logo.svg'; -import './App.css'; +import styled from 'styled-components'; + +import Input from './components/Input'; +import Results from './components/Results'; + +const Container = styled.div` + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + padding: 15px; + border-radius: 4px; + box-shadow: 0 0 4px 0 #777; +`; class App extends Component { + state = { + number: null, + foundPRs: [] + }; + + handleInputChange = (event) => { + const { value } = event.target; + + this.setState((prevState) => ({ number: value })); + } + + handleButtonClick = () => { + const { number } = this.state; + + fetch(`https://pr-relations.glitch.me/test/${number}`) + .then((response) => response.json()) + .then(({ foundPRs }) => { + console.log(foundPRs); + this.setState((prevState) => ({ foundPRs })) + }); + } + render() { + const { foundPRs } = this.state; + return ( -
- Edit src/App.js
and save to reload.
-