From daf32dac916f35940d13f8a82291d269cbe4f33a Mon Sep 17 00:00:00 2001 From: Flavio Lima Date: Wed, 30 Dec 2020 13:54:58 +0100 Subject: [PATCH] feat: updated App to load new component --- src/App.css | 74 ++++++++++++++++++++++++++++++++++++--------------- src/App.tsx | 53 +++++++++++++++++++++++------------- src/index.css | 6 +++++ 3 files changed, 92 insertions(+), 41 deletions(-) diff --git a/src/App.css b/src/App.css index 74b5e05345..45f5c78139 100644 --- a/src/App.css +++ b/src/App.css @@ -1,38 +1,68 @@ .App { text-align: center; + color: #929292; } -.App-logo { - height: 40vmin; - pointer-events: none; +.gameList { + color: #F5F5F5; + display: grid; + grid-template-columns: minmax(210px, max-content) repeat(auto-fill, 210px) 4%; } -@media (prefers-reduced-motion: no-preference) { - .App-logo { - animation: App-logo-spin infinite 20s linear; - } +.gameCard { + margin: 0 4px; + background-color: #2B2B2B; + text-align: left; + display: flex; + flex-direction: column; + justify-content: space-between; + width: 195px; + height: 300px; + border-radius: 5px; + margin-bottom: 6px; } -.App-header { - background-color: #282c34; - min-height: 100vh; +.gameImg { + max-height: 230px; + width: 180px; display: flex; - flex-direction: column; align-items: center; justify-content: center; - font-size: calc(10px + 2vmin); - color: white; + margin: 4px; + height: 225px; +} + +.gameTitle { + text-align: center; + margin: auto 4px; + font-size: 14px; +} + +.gameCard:hover { + background-color: #0078F2; +} + +.gameConfig { + display: flex; } -.App-link { - color: #61dafb; +.gameInfo { + text-align: initial; + margin-left: 16px; + font-size: 22px; + color: white; + display: flex; + flex-direction: column; + justify-content: space-between; } -@keyframes App-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } +.button { + width: fit-content; + padding: 0 12px; + border-radius: 5px; + text-transform: uppercase; } + +.button :hover { + background-color: black; +} \ No newline at end of file diff --git a/src/App.tsx b/src/App.tsx index a53698aab3..91caf89b98 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,26 +1,41 @@ import React from 'react'; -import logo from './logo.svg'; +import { HashRouter, Route, Switch } from 'react-router-dom'; + import './App.css'; +import { Library } from './components/Library'; +import GameConfig from './components/UI/GameConfig'; +import { getLegendaryConfig } from './helper'; + +function App() { + const [config, setConfig] = React.useState({} as any) + + React.useEffect(() => { + const updateConfig = async() => { + const newConfig = await getLegendaryConfig() + newConfig && setConfig(newConfig) + } + updateConfig() + }, []) -function App() { - return ( -
-
- logo -

- Edit src/App.tsx and save to reload. -

- - Learn React - -
-
+ if (Object.keys(config).length) { + const { user, library } = config; + + if (!user) { + return null + } + + return ( + +
+ + } /> + + +
+
); } +return null +} export default App; diff --git a/src/index.css b/src/index.css index ec2585e8c0..36f47b986a 100644 --- a/src/index.css +++ b/src/index.css @@ -5,6 +5,12 @@ body { sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; + background-color: #121212; +} + +a { + color: white; + text-decoration: none; } code {