From 32c27f278e4c5b6bef88b9fd13b271d7d60e0894 Mon Sep 17 00:00:00 2001 From: Zeljko Predjeskovic Date: Sun, 21 Feb 2021 20:49:00 +0100 Subject: [PATCH 1/2] Result page and css --- frontend/src/components/Register.jsx | 2 +- frontend/src/components/Result.jsx | 31 ++++++++++++++++++++++++++++ frontend/src/css/Result.css | 29 ++++++++++++++++++++++++++ frontend/src/index.js | 8 ++++--- 4 files changed, 66 insertions(+), 4 deletions(-) create mode 100644 frontend/src/components/Result.jsx create mode 100644 frontend/src/css/Result.css diff --git a/frontend/src/components/Register.jsx b/frontend/src/components/Register.jsx index dc0037f..2eb8be1 100644 --- a/frontend/src/components/Register.jsx +++ b/frontend/src/components/Register.jsx @@ -1,7 +1,7 @@ import React from "react"; async function createUser(newUsername, newPassword){ - const response= await fetch('http://localhost:3000/user/',{ + const response= await fetch('http://localhost:3001/user',{ method: 'POST', headers: { 'Accept' : 'application/json', diff --git a/frontend/src/components/Result.jsx b/frontend/src/components/Result.jsx new file mode 100644 index 0000000..a06a0df --- /dev/null +++ b/frontend/src/components/Result.jsx @@ -0,0 +1,31 @@ +import React from "react"; +import "../css/Result.css"; + +const data = +{Place: 500, + +Challenge:"100 meter sprint", + +pointsEarned:100, + +Time: "14 seconds"}; + +export default function Result(){ +return( +
+
+
Results of {data.Challenge}
+
+ +
Place
+
{data.Place}
+
Time
+
{data.Time}
+
Points Earned
+
{data.pointsEarned}
+
+
+
+
+ +);} \ No newline at end of file diff --git a/frontend/src/css/Result.css b/frontend/src/css/Result.css new file mode 100644 index 0000000..5c84ea1 --- /dev/null +++ b/frontend/src/css/Result.css @@ -0,0 +1,29 @@ +body { + background-color: cornsilk; +} + +.resultDiv { + display: flex; + align-items: center; + justify-content: center, space-evenly; + margin-top: 5%; + flex-direction: column; +} + +.title { + color: blueviolet; + font-family: bahnschrift; + font-size: 24pt; +} + +.tableResult { + margin-top: 5%; + font-size: 14pt; +} + +.tableItems { + margin-top: 15%; + font-size: 20pt; + color: blueviolet; + font-weight: bolder; +} diff --git a/frontend/src/index.js b/frontend/src/index.js index 4205bd4..46085a3 100644 --- a/frontend/src/index.js +++ b/frontend/src/index.js @@ -2,9 +2,10 @@ import React from "react"; import ReactDOM from "react-dom"; import { BrowserRouter, Route, Switch } from "react-router-dom"; import App from "./components/App"; -import Contact from "./components/pages/Contact" -import Register from './components/Register' -import Login from './components/Login' +import Contact from "./components/pages/Contact"; +import Register from './components/Register'; +import Login from './components/Login'; +import Result from './components/Result'; const Routing = () => { return( @@ -14,6 +15,7 @@ const Routing = () => { + ) From 3d98da3453ce4c6ab07ca339feceaf205b0dbe94 Mon Sep 17 00:00:00 2001 From: Zeljko Predjeskovic Date: Tue, 23 Feb 2021 00:40:46 +0100 Subject: [PATCH 2/2] result css --- frontend/src/components/Result.jsx | 1 + frontend/src/css/Result.css | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Result.jsx b/frontend/src/components/Result.jsx index a06a0df..70fc315 100644 --- a/frontend/src/components/Result.jsx +++ b/frontend/src/components/Result.jsx @@ -1,6 +1,7 @@ import React from "react"; import "../css/Result.css"; + const data = {Place: 500, diff --git a/frontend/src/css/Result.css b/frontend/src/css/Result.css index 5c84ea1..084565a 100644 --- a/frontend/src/css/Result.css +++ b/frontend/src/css/Result.css @@ -8,11 +8,12 @@ body { justify-content: center, space-evenly; margin-top: 5%; flex-direction: column; + font-family: bahnschrift; } .title { + font-weight: bolder; color: blueviolet; - font-family: bahnschrift; font-size: 24pt; }