diff --git a/public/index.html b/public/index.html index 75980d5..8fff65a 100644 --- a/public/index.html +++ b/public/index.html @@ -3,6 +3,7 @@ + { return (
- setInput(evt.target.value)} /> +
+
+ { playerStats === null ? "Loading" : +
    +
  • XP: {playerStats.xp}
  • +
  • Quests: {playerStats.quests_completed}/{playerStats.total_quests}
  • +
  • Side Quests: {playerStats.side_quests_completed}/{playerStats.total_side_quests}
  • +
+ } +
+
); } diff --git a/src/index.js b/src/index.js index 69e66d0..51bd5b9 100644 --- a/src/index.js +++ b/src/index.js @@ -1,7 +1,7 @@ import React, { useState } from "react"; import ReactDOM from "react-dom"; -import "./scss/index.scss"; import "nes.css/css/nes.min.css"; +import "./scss/index.scss"; import { config } from "./config"; import axios from "axios"; import login from "./components/login"; @@ -11,7 +11,7 @@ import models from "./models"; const { player } = models(config, axios); const Login = login(player); -const MainApp = mainapp(); +const MainApp = mainapp(player); function App(){ const [loggedIn, setLoggedIn] = useState(false); diff --git a/src/models/player.js b/src/models/player.js index 0feadf6..f111e0c 100644 --- a/src/models/player.js +++ b/src/models/player.js @@ -3,4 +3,14 @@ export default (config, axios) => {return { return axios.get(`${config.apiUrl}/auth?token=${encodeURIComponent(token)}`) .then((res) => res.data.success); }, + player: (token) => { + return axios.get(`${config.apiUrl}/player?token=${encodeURIComponent(token)}`) + .then((res) => { + if (res.status !== 200) { + return false; + } else { + return res.data; + } + }); + }, };}; diff --git a/src/scss/index.scss b/src/scss/index.scss index 861933c..8a4da1b 100644 --- a/src/scss/index.scss +++ b/src/scss/index.scss @@ -1,3 +1,11 @@ +body { + margin: 0; + padding: 0; + background-color: #383838; + color: #FFF; + font-family: "Press Start 2P"; +} + .login { padding: 15%; display: flex; @@ -19,3 +27,23 @@ } } } + +.main { + header { + width: 100%; + padding: 1em 3em; + display: flex; + justify-content: space-between; + background-color: #000; + h1 { + font-family: "Ubuntu"; + } + } + .body { + padding: 1em; + } +} + +.nes-list.is-circle li::before { + color: #FFF; +}