From fbf3ab02138f595b7082f9b69980018c952acf7e Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Tue, 15 Sep 2020 01:25:20 -0700 Subject: [PATCH] Clean up App component --- src/App.css | 2 ++ src/App.tsx | 49 +------------------------------------------------ 2 files changed, 3 insertions(+), 48 deletions(-) diff --git a/src/App.css b/src/App.css index 9e1cda4d..5775252a 100644 --- a/src/App.css +++ b/src/App.css @@ -10,5 +10,7 @@ a { h1 { color: #444; + font-size: 18px; font-weight: 500; + text-align: center; } \ No newline at end of file diff --git a/src/App.tsx b/src/App.tsx index 7db2fe63..887010d2 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -5,54 +5,7 @@ import Header from './components/Header/Header' import Main from './Main/Main' function App() { - const [parties, setParties] = useState(false) - - useEffect(() => { - getParty() - }, []) - - function getParty() { - fetch('http://localhost:3001/parties') - .then(response => { - return response.text() - }) - .then(data => { - setParties((data != null) ? true : false) - }) - } - - function createParty() { - fetch('http://localhost:3001/parties', { - method: 'POST', - headers: { - 'Content-Type': 'application/json' - } - // body: JSON.stringify({stuff}) - }) - .then(response => { - return response.text() - }) - .then(data => { - alert(data) - getParty() - }) - } - - function deleteParty() { - let hash = prompt('Enter hash') - fetch(`http://localhost:3001/parties/${hash}`, { - method: 'DELETE' - }) - .then(response => { - return response.text() - }) - .then(data => { - alert(data) - getParty() - }) - } - - return ( + return (