├── public ├── favicon.ico ├── manifest.json └── index.html ├── src ├── stylesheets │ ├── HostInfo.css │ ├── Host.css │ ├── Headquarters.css │ ├── App.css │ └── Area.css ├── services │ ├── Images.js │ └── Log.js ├── index.js ├── App.test.js ├── components │ ├── HostList.js │ ├── WestworldMap.js │ ├── Host.js │ ├── ColdStorage.js │ ├── Details.js │ ├── Area.js │ ├── Headquarters.js │ ├── LogPanel.js │ └── HostInfo.js ├── App.js └── registerServiceWorker.js ├── .gitignore ├── package.json ├── db.json └── README.md /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MinesJA/westworld-command-center-react/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /src/stylesheets/HostInfo.css: -------------------------------------------------------------------------------- 1 | .hostImg { 2 | overflow: hidden; 3 | height: 160px; 4 | width: 130px; 5 | } 6 | -------------------------------------------------------------------------------- /src/services/Images.js: -------------------------------------------------------------------------------- 1 | export const westworldLogo = "https://www.hbo.com/content/dam/hbodata/series/westworld/episodes/s-01/westworld-s1-1920x1080.jpg" 2 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | import 'semantic-ui-css/semantic.min.css'; 5 | 6 | ReactDOM.render(, document.getElementById('root')); 7 | -------------------------------------------------------------------------------- /src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | ReactDOM.unmountComponentAtNode(div); 9 | }); 10 | -------------------------------------------------------------------------------- /src/components/HostList.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Card } from 'semantic-ui-react' 3 | 4 | const HostList = () => { 5 | 6 | return( 7 | 8 | {/* What do you think, partner? */} 9 | 10 | ) 11 | } 12 | 13 | export default HostList 14 | -------------------------------------------------------------------------------- /src/components/WestworldMap.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Segment } from 'semantic-ui-react'; 3 | 4 | 5 | const WestworldMap = () => { 6 | 7 | return ( 8 | 9 | {/* What should we render on the map? */} 10 | 11 | ) 12 | } 13 | 14 | export default WestworldMap 15 | -------------------------------------------------------------------------------- /src/stylesheets/Host.css: -------------------------------------------------------------------------------- 1 | a.ui.raised.card.host { 2 | width: 50px; 3 | height: 50px; 4 | overflow: hidden; 5 | } 6 | 7 | a.ui.raised.card.selected { 8 | border: 2px solid red; 9 | borderRadius: 5px; 10 | } 11 | 12 | a.ui.raised.card.selected:hover { 13 | border: 2px solid red; 14 | borderRadius: 5px; 15 | } 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /build 11 | 12 | # misc 13 | .DS_Store 14 | .env.local 15 | .env.development.local 16 | .env.test.local 17 | .env.production.local 18 | 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /src/components/Host.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import '../stylesheets/Host.css' 3 | import { Card } from 'semantic-ui-react' 4 | 5 | const Host = () => { 6 | 7 | return( 8 | 15 | ) 16 | } 17 | 18 | export default Host 19 | -------------------------------------------------------------------------------- /src/stylesheets/Headquarters.css: -------------------------------------------------------------------------------- 1 | .HQComps { 2 | height: 100%; 3 | margin: 2px; 4 | padding: 2px; 5 | } 6 | 7 | #details { 8 | display: flex; 9 | justify-content: center; 10 | align-items: center; 11 | } 12 | 13 | logpanel { 14 | width: 100%; 15 | } 16 | 17 | pre { 18 | height: 120px; 19 | overflow-y: scroll; 20 | white-space: pre-wrap; 21 | } 22 | 23 | .error { 24 | color: red; 25 | } 26 | 27 | .warn { 28 | color: orange; 29 | } 30 | 31 | .notify { 32 | color: black; 33 | } 34 | -------------------------------------------------------------------------------- /src/components/ColdStorage.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Segment } from 'semantic-ui-react' 3 | 4 | const ColdStorage = () => ( 5 | 6 | 7 |

ColdStorage

8 |
9 | 10 | 11 | {/* Cold Storage contains hosts....but how? Directly? Or is there something else we could use to contain them... */} 12 | 13 | 14 |
15 | ) 16 | 17 | export default ColdStorage 18 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "westworld", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "json-server": "^0.14.0", 7 | "react": "^16.4.0", 8 | "react-dom": "^16.4.0", 9 | "react-scripts": "1.1.4", 10 | "semantic-ui-css": "^2.3.1", 11 | "semantic-ui-react": "^0.80.2" 12 | }, 13 | "scripts": { 14 | "start": "react-scripts start", 15 | "build": "react-scripts build", 16 | "test": "react-scripts test --env=jsdom", 17 | "eject": "react-scripts eject" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/services/Log.js: -------------------------------------------------------------------------------- 1 | export class Log { 2 | static error(msg){ 3 | let date = new Date(); 4 | let time = date.toLocaleTimeString(); 5 | return {type: 'error', msg: `[${time}] ERROR: ${msg}`} 6 | } 7 | 8 | static warn(msg){ 9 | let date = new Date(); 10 | let time = date.toLocaleTimeString(); 11 | return {type: 'warn', msg: `[${time}] WARN: ${msg}`} 12 | } 13 | 14 | static notify(msg){ 15 | let date = new Date(); 16 | let time = date.toLocaleTimeString(); 17 | return {type: 'notify', msg: `[${time}] NOTIFY: ${msg}`} 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/components/Details.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Segment, Image } from 'semantic-ui-react' 3 | import * as Images from '../services/Images' 4 | 5 | 6 | const Details = () => { 7 | // We'll render the logo if no host is selected. But if a host does get selected.... 8 | // Watch the video to see how this works in the app. 9 | 10 | const renderSomething = () => () 11 | 12 | return( 13 | 14 | {renderSomething()} 15 | 16 | ) 17 | } 18 | 19 | export default Details 20 | -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import './stylesheets/App.css' 3 | import { Segment } from 'semantic-ui-react'; 4 | 5 | 6 | class App extends Component { 7 | 8 | // As you go through the components given you'll see a lot of functional components. 9 | // But feel free to change them to whatever you want. 10 | // It's up to you whether they should be stateful or not. 11 | 12 | render(){ 13 | return ( 14 | 15 | {/* What components should go here? Check out Checkpoint 1 of the Readme if you're confused */} 16 | 17 | ) 18 | } 19 | } 20 | 21 | export default App; 22 | -------------------------------------------------------------------------------- /src/stylesheets/App.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: sans-serif; 5 | display: flex; 6 | justify-content: center; 7 | flex-direction: column; 8 | align-items: center; 9 | } 10 | 11 | h3 { 12 | padding: 5px; 13 | color: white; 14 | background-color: black; 15 | } 16 | 17 | #app { 18 | width: 1500px; 19 | height: 1000px; 20 | padding-left: 0px 10px; 21 | display: flex; 22 | flex-direction: column; 23 | align-items: center; 24 | } 25 | 26 | #map { 27 | background-image: url("http://i.imgur.com/2fVdhfG.jpg"); 28 | background-size: 100%; 29 | position: relative; 30 | width: 100%; 31 | height: 695px; 32 | } 33 | -------------------------------------------------------------------------------- /src/components/Area.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import '../stylesheets/Area.css' 3 | 4 | const Area = () => ( 5 | 6 |
7 |

{/* Don't just pass in the name from the data...clean that thing up */}

8 | 9 | {/* See Checkpoint 1 item 2 in the Readme for a clue as to what goes here */} 10 | 11 |
12 | 13 | ) 14 | 15 | Area.propTypes = { 16 | hosts: function(props, propName, componentName){ 17 | if(props.hosts.length > props.limit){ 18 | throw Error( 19 | `HEY!! You got too many hosts in ${props.name}. The limit for that area is ${props.limit}. You gotta fix that!` 20 | ) 21 | } 22 | } 23 | } 24 | 25 | export default Area; 26 | -------------------------------------------------------------------------------- /src/components/Headquarters.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import '../stylesheets/Headquarters.css'; 3 | import { Grid } from 'semantic-ui-react'; 4 | import Details from './Details' 5 | 6 | 7 | class Headquarters extends Component { 8 | // Remember, there's many ways to do this. This doesn't have to be a class component. It's up to you. 9 | 10 | render(){ 11 | return( 12 | 13 | 14 | 15 | {/* Something goes here.... */} 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | {/* and here. Take visual cues from the screenshot/video in the Readme. */} 24 | 25 | 26 | 27 | ) 28 | } 29 | } 30 | 31 | export default Headquarters; 32 | -------------------------------------------------------------------------------- /src/stylesheets/Area.css: -------------------------------------------------------------------------------- 1 | .area{ 2 | border: 2px solid red; 3 | position: absolute; 4 | } 5 | 6 | .labels { 7 | padding: 5px; 8 | } 9 | 10 | #high_plains { 11 | top: 20px; 12 | left: 315px; 13 | width: 300px; 14 | padding: 10px; 15 | min-height: 200px; 16 | max-height: 200px; 17 | height: 100%; 18 | } 19 | 20 | #lowlands{ 21 | top: 225px; 22 | left: 360px; 23 | width: 265px; 24 | padding: 10px; 25 | min-height: 190px; 26 | max-height: 190px; 27 | height: 100%; 28 | } 29 | 30 | #under_construction{ 31 | top: 425px; 32 | left: 350px; 33 | width: 300px; 34 | padding: 10px; 35 | min-height: 200px; 36 | max-height: 200px; 37 | height: 100%; 38 | } 39 | 40 | #pariah{ 41 | top: 450px; 42 | left: 680px; 43 | width: 500px; 44 | padding: 10px; 45 | min-height: 185px; 46 | max-height: 185px; 47 | height: 100%; 48 | } 49 | 50 | #python_pass{ 51 | top: 10px; 52 | left: 660px; 53 | width: 500px; 54 | padding: 10px; 55 | min-height: 185px; 56 | max-height: 185px; 57 | height: 100%; 58 | } 59 | 60 | #badlands{ 61 | top: 225px; 62 | left: 700px; 63 | width: 400px; 64 | padding: 10px; 65 | min-height: 175px; 66 | max-height: 175px; 67 | height: 100%; 68 | } 69 | -------------------------------------------------------------------------------- /src/components/LogPanel.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Segment, Button } from 'semantic-ui-react'; 3 | import { Log } from '../services/Log' 4 | 5 | const LogPanel = () => { 6 | 7 | const dummyLogs = () => { 8 | // This is just to show you how this should work. But where should the log data actually get stored? 9 | // And where should we be creating logs in the first place? 10 | // Use the Log Service class (located in: 'src/services/Log') we've created anywhere you like. 11 | // Just remember to import it 12 | 13 | let logs = [] 14 | 15 | logs.unshift(Log.warn("This is an example of a warn log")) 16 | logs.unshift(Log.notify("This is an example of a notify log")) 17 | logs.unshift(Log.error("This is an example of an error log")) 18 | 19 | return logs 20 | } 21 | 22 | return( 23 | 24 |
25 |         {dummyLogs().map((log, i) => 

{log.msg}

)} 26 |
27 | 28 | {/* Button below is the Activate All/Decommisssion All button */} 29 |