From fd7197a1d4bee5837b240835c25883ca1b6238e3 Mon Sep 17 00:00:00 2001 From: Antti Pilto Date: Fri, 28 Apr 2017 21:14:06 +0300 Subject: [PATCH] remove demo specific code --- src/components/App/App.jsx | 12 ++++++++-- src/components/App/App.scss | 17 ++++++++++++++ src/components/Footer/Footer.jsx | 37 ------------------------------- src/components/Footer/Footer.scss | 16 ------------- 4 files changed, 27 insertions(+), 55 deletions(-) delete mode 100644 src/components/Footer/Footer.jsx delete mode 100644 src/components/Footer/Footer.scss diff --git a/src/components/App/App.jsx b/src/components/App/App.jsx index 46c5601..b86c168 100644 --- a/src/components/App/App.jsx +++ b/src/components/App/App.jsx @@ -2,7 +2,6 @@ import React, { Component } from 'react'; import './App.scss'; import Navbar from '../Navbar/Navbar'; import GameContainer from '../GameContainer/GameContainer'; -import Footer from '../Footer/Footer'; import { removeHash } from '../../data/helperFuncs'; const options = {}; @@ -25,6 +24,16 @@ class App extends Component { this.setState({gameState: 'chooseCharacters'}); } + componentWillUpdate(nextProps, nextState) { + // This is primarily for demo site purposes. Hides footer when game is on. + if(document.getElementById('footer')) { + if(nextState.gameState=='chooseCharacters') + document.getElementById('footer').style.visibility = "visible"; + else + document.getElementById('footer').style.visibility = "hidden"; + } + } + render() { return (
@@ -41,7 +50,6 @@ class App extends Component { />
- {this.state.gameState=='chooseCharacters'?