Broke up the home page

This commit is contained in:
2019-05-26 04:28:40 +10:00
parent f949617284
commit 6095261c27
14 changed files with 233 additions and 109 deletions
+4 -3
View File
@@ -24,7 +24,7 @@ class CommonLinks extends React.Component {
//disable the profile link when logged out
let ProfileLink;
if (this.props.loggedIn) {
ProfileLink = () => <p>Go to <Link to='/profile' onClick={this.props.onClickProfile}>your profile</Link></p>;
ProfileLink = () => <p><Link to='/profile' onClick={this.props.onClickProfile}>Your Profile</Link></p>;
} else {
ProfileLink = () => null;
}
@@ -40,9 +40,10 @@ class CommonLinks extends React.Component {
return (
<div className='panel'>
<p>Return <Link to='/' onClick={this.props.onClickHome}>home</Link></p>
<p><Link to='/' onClick={this.props.onClickHome}>Return Home</Link></p>
<ProfileLink />
<p>Go to <Link to='/ladder' onClick={this.props.onClickLadder}>the game ladder</Link></p>
<p><Link to='/ladder' onClick={this.props.onClickLadder}>Game Ladder</Link></p>
<p><Link to='/passwordchange' onClick={this.props.onClickLadder}>Change Password</Link></p>
<Extra />
+2
View File
@@ -75,6 +75,8 @@ class Login extends React.Component {
//send the XHR
xhr.open('POST', form.action, true);
xhr.send(formData);
this.clearInput();
}
validateInput(e) {
+1 -1
View File
@@ -65,7 +65,7 @@ class PasswordChange extends React.Component {
//DEBUGGING
if (this.props.onPasswordChange) {
this.props.onPasswordChange();
this.props.onPasswordChange(json.msg);
}
}
+10 -2
View File
@@ -1,7 +1,8 @@
import React from 'react';
import { validateEmail } from '../../../common/utilities.js';
import PropTypes from 'prop-types';
export default class Signup extends React.Component {
class Signup extends React.Component {
constructor(props) {
super(props);
this.state = {
@@ -70,6 +71,7 @@ export default class Signup extends React.Component {
if (xhr.status === 200) {
if (this.props.onSignup) {
this.props.onSignup(xhr.responseText);
console.log('trying to...');
}
}
@@ -150,4 +152,10 @@ export default class Signup extends React.Component {
retype: evt.target.value
});
}
}
}
Signup.propTypes = {
onSignup: PropTypes.func
};
export default Signup;