diff --git a/public/styles/shared.css b/public/styles/shared.css index 7e9cc20..b772b01 100644 --- a/public/styles/shared.css +++ b/public/styles/shared.css @@ -46,15 +46,6 @@ br { padding-bottom: .5rem; } -hr { - border: none; - height: 1px; - color: lightblue; - background-color: lightblue; - margin-top: 1em; - margin-bottom: 2em; -} - ul { list-style-type: disc; list-style-position: inside; @@ -164,15 +155,15 @@ footer { } } -.panel.right, .panel.center { +.panel.right { align-items: center; } -.panel.right .warning, .panel.center .warning { +.panel.right .warning { align-self: stretch; } -.panel.right form, .panel.center form { +.panel.right form { flex: 1; display: flex; flex-direction: column; @@ -180,14 +171,14 @@ footer { align-self: stretch; } -.panel.right form button, .panel.center form button { +.panel.right form button { align-self: stretch; margin-top: .2em; margin-bottom: .2em; } @media screen and (max-width: 480px) { - .panel.right h1, .panel.center h1 { + .panel.right h1 { font-size: 16px; } } @@ -247,4 +238,13 @@ footer { /* bits and pieces */ .logoutButton { align-self: stretch; +} + +.newsLine { + border: none; + height: 1px; + color: lightblue; + background-color: lightblue; + margin-top: 1em; + margin-bottom: 2em; } \ No newline at end of file diff --git a/src/components/pages/home.jsx b/src/components/pages/home.jsx index ccf059d..75c9742 100644 --- a/src/components/pages/home.jsx +++ b/src/components/pages/home.jsx @@ -17,34 +17,13 @@ class Home extends React.Component { //rendering function render() { - //get the correct side panel - let SidePanel; - - if (this.props.id) { //logged in - SidePanel = () => { - return ( -
- -
- ); - } - } else { //logged out - SidePanel = () => { - return ( -
-

Sign Up

-

Login

-

Recover Password

-
- ); - } - } - //return the home page return (
- +
+ +
diff --git a/src/components/panels/common_links.jsx b/src/components/panels/common_links.jsx index abffe14..b17e36a 100644 --- a/src/components/panels/common_links.jsx +++ b/src/components/panels/common_links.jsx @@ -1,6 +1,7 @@ import React from 'react'; import { withRouter, Link } from 'react-router-dom'; import { connect } from 'react-redux'; +import PropTypes from 'prop-types'; import Logout from './logout.jsx'; @@ -21,38 +22,46 @@ class CommonLinks extends React.Component { Extra = () => null; } - //disable the profile link when logged out - let ProfileLink; + //if logged in if (this.props.loggedIn) { - ProfileLink = () =>

Your Profile

; - } else { - ProfileLink = () => null; + return ( +
+

Return Home

+

Your Profile

+

Game Ladder

+

Change Password

+ + + + this.props.history.push('/')} /> +
+ ); + } else { //if not logged in + return ( +
+

Sign Up

+

Login

+

Recover Password

+

Return Home

+

Game Ladder

+ + +
+ ); } - - //disable the logout button when logged out - let LogoutLink; - if (this.props.loggedIn) { - LogoutLink = () => this.props.history.push('/')} />; - } else { - LogoutLink = () => null; - } - - - return ( -
-

Return Home

- -

Game Ladder

-

Change Password

- - - - -
- ); } } +CommonLinks.propTypes = { + onClickSignup: PropTypes.func, + onClickLogin: PropTypes.func, + onClickPasswordRecover: PropTypes.func, + onClickHome: PropTypes.func, + onClickProfile: PropTypes.func, + onClickLadder: PropTypes.func, + onClickPasswordChange: PropTypes.func +}; + function mapStoreToProps(store) { return { loggedIn: store.account.id !== 0 diff --git a/src/components/panels/news_panel.jsx b/src/components/panels/news_panel.jsx index 79df07d..ba3e531 100644 --- a/src/components/panels/news_panel.jsx +++ b/src/components/panels/news_panel.jsx @@ -15,7 +15,7 @@ class NewsPanel extends React.Component { render() { return (
- {Object.keys(this.state.data).map((key) =>

)} + {Object.keys(this.state.data).map((key) =>

)}
); }