Skip to content

Commit

Permalink
#97 Added new route and navbar button to studyGroup Form
Browse files Browse the repository at this point in the history
  • Loading branch information
ONourry committed Mar 5, 2017
1 parent f977759 commit 26bd530
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion client/modules/App/components/Header/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ export class Header extends Component {
</div>
<div className="collapse navbar-collapse" id="navbarNav">
<ul className={`nav navbar-nav ${styles.right}`}>
<li className="nav-item active">
<Link className={`nav-link ${styles['nav-links-inline']}`} to="/registerGroup">Create Study Group</Link>
</li>
<li className="nav-item active">
<i className={`${styles['small-nav-icon']} fa fa-home`} aria-hidden="true"></i>
<Link className={`nav-link ${styles['nav-links-inline']}`}>Home</Link>
<Link className={`nav-link ${styles['nav-links-inline']}`} to="/profile">Home</Link>
</li>
<li className="nav-item" id={styles.signout}>
<Link onClick={this.handleLogout} className={`nav-link ${styles['nav-links-inline']}`}>Sign Out</Link>
Expand Down
2 changes: 1 addition & 1 deletion client/modules/User/UserActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export function logoutUserRequest() {

export function createStudyGroup(studyGroup) {
console.log(studyGroup);
browserHistory.replace('/');
browserHistory.replace('/profile');
return {
type: CREATE_GROUP,
studyGroup,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export class UserRegistrationForm extends Component {
addUser = (e) => {
console.log(this.state);
if (this.state.nickname && this.state.studentId && this.state.email && this.state.password) {
this.props.addUser(this.state.nickname, this.state.studentId, this.state.email, this.state.password);
this.notifyUser();
this.props.addUser(this.state.nickname, this.state.studentId, this.state.email, this.state.password);
this.setState({ nickname: '', studentId: '', email: '', password: '' });
//To stop the page from refreshing
e.preventDefault();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { injectIntl, intlShape, FormattedMessage } from 'react-intl';
import Validation from 'react-validation';

import Valid from '../FormComponents/Validator';
import styles from './UserRegistrationForm.css';
import styles from './UserStudyGroupForm.css';

export class UserStudyGroupForm extends Component {
constructor(props) {
Expand Down
2 changes: 2 additions & 0 deletions client/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Route, IndexRoute } from 'react-router';
import App from './modules/App/App';
import UserDashboardPage from './modules/User/pages/UserDashboardPage/UserDashboardPage';
import UserRegistrationPage from './modules/User/pages/UserRegistrationPage/UserRegistrationPage';
import UserStudyGroupPage from './modules/User/pages/UserStudyGroupPage/UserStudyGroupPage';

// require.ensure polyfill for node
if (typeof require.ensure !== 'function') {
Expand Down Expand Up @@ -32,6 +33,7 @@ export default (
});
}}
/>
<Route path="/registerGroup" component={UserStudyGroupPage} />
<Route path="/register" component={UserRegistrationPage} />
<Route path="/profile" component={UserDashboardPage} />
</Route>
Expand Down

0 comments on commit 26bd530

Please sign in to comment.