This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import ReactDOM from 'react-dom'; | |
| import createHistory from 'history/createBrowserHistory'; | |
| import { createStore, combineReducers, applyMiddleware } from 'redux'; | |
| import { ConnectedRouter, routerReducer, routerMiddleware } from 'react-router-redux'; | |
| import { Provider } from 'react-redux'; | |
| import createSagaMiddleware from 'redux-saga'; | |
| import { composeWithDevTools } from 'redux-devtools-extension/developmentOnly'; | |
| import 'bootstrap'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| import Header from 'components/Header'; | |
| import Routes from 'routes'; | |
| import LoginFormModal from 'components/LoginForm'; | |
| import './App.scss'; | |
| export class App extends Component { | |
| state = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| export default function AboutView() { | |
| return ( | |
| <div className="about-view m-3"> | |
| <h1>ABOUT PAGE</h1> | |
| </div> | |
| ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| import PropTypes from 'prop-types'; | |
| import { connect } from 'react-redux'; | |
| import { AsyncAboutView } from 'asyncViews'; | |
| import { getProfile } from 'actions/access.actions'; | |
| import get from 'lodash/get'; | |
| import ProfilePlaceholder from 'assets/img/profile_placeholder.png'; | |
| import { isValidURL } from 'utils/utils'; | |
| import './homeView.scss'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| import PropTypes from 'prop-types'; | |
| import { withRouter } from 'react-router'; | |
| import { connect } from 'react-redux'; | |
| import Cookies from 'js-cookie'; | |
| import get from 'lodash/get'; | |
| import includes from 'lodash/includes'; | |
| import { login } from 'actions/access.actions'; | |
| import toggleLogin from 'actions/modals.actions'; | |
| import cn from 'classnames'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| onFacebookLogin = () => { | |
| const inOneHour = new Date(new Date().getTime() + 60 * 60 * 1000); | |
| Cookies.set('lastLocation_before_logging', this.props.location.pathname, { expires: inOneHour }); | |
| window.location.href = `${window.location.origin}/auth/facebook`; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as ActionTypes from 'constants/actionTypes'; | |
| export const login = (email, password) => ({ | |
| type: ActionTypes.LOGIN_REQUESTED, | |
| email, | |
| password, | |
| }); | |
| export const logout = () => ({ | |
| type: ActionTypes.LOGOUT_REQUESTED, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as ActionTypes from 'constants/actionTypes'; | |
| const toggleLogin = newState => ({ | |
| type: ActionTypes.TOGGLE_MODAL_REQUESTED, | |
| newState, | |
| }); | |
| export default toggleLogin; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { all, fork } from 'redux-saga/effects'; | |
| import { watchGetProfile, watchLogout, watchLogin } from './access.sagas'; | |
| import watchToggleModal from './modals.sagas'; | |
| export default function* rootSaga() { | |
| yield all([ | |
| fork(watchGetProfile), | |
| fork(watchLogin), | |
| fork(watchLogout), | |
| fork(watchToggleModal), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { put, call, takeLatest } from 'redux-saga/effects'; | |
| import Cookies from 'js-cookie'; | |
| import * as ActionTypes from 'constants/actionTypes'; | |
| import { get, post } from 'utils/api'; | |
| import lGet from 'lodash/get'; | |
| function* login(action) { | |
| const { email, password } = action; | |
| try { | |
| const response = yield call( |