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
| REACT_APP_API_URL=http://localhost:4000/api |
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
| const API = process.env.REACT_APP_API_URL; | |
| function headers() { | |
| const token = JSON.parse(localStorage.getItem('token')); | |
| return { | |
| Accept: 'application/json', | |
| 'Content-Type': 'application/json', | |
| Authorization: `Bearer: ${token}`, | |
| }; |
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 { reset } from 'redux-form'; | |
| import api from '../api'; | |
| function setCurrentUser(dispatch, response) { | |
| localStorage.setItem('token', JSON.stringify(response.meta.token)); | |
| dispatch({ type: 'AUTHENTICATION_SUCCESS', response }); | |
| } | |
| export function login(data, router) { | |
| return dispatch => api.post('/sessions', data) |
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
| // @flow | |
| import React from 'react'; | |
| type Props = { | |
| input: Object, | |
| label?: string, | |
| type?: string, | |
| placeholder?: string, | |
| style?: Object, | |
| meta: Object, |
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
| // @flow | |
| import React, { Component } from 'react'; | |
| import { Field, reduxForm } from 'redux-form'; | |
| import { Link } from 'react-router'; | |
| import { css, StyleSheet } from 'aphrodite'; | |
| import Input from '../Input'; | |
| const styles = StyleSheet.create({ | |
| card: { | |
| maxWidth: '500px', |
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
| // @flow | |
| import React, { Component } from 'react'; | |
| import { Field, reduxForm } from 'redux-form'; | |
| import { Link } from 'react-router'; | |
| import { css, StyleSheet } from 'aphrodite'; | |
| import Input from '../Input'; | |
| const styles = StyleSheet.create({ | |
| card: { | |
| maxWidth: '500px', |
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
| // @flow | |
| import React from 'react'; | |
| import { Link } from 'react-router'; | |
| import { css, StyleSheet } from 'aphrodite'; | |
| const styles = StyleSheet.create({ | |
| navbar: { | |
| display: 'flex', | |
| alignItems: 'center', | |
| padding: '0 1rem', |
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
| // @flow | |
| import React, { Component, PropTypes } from 'react'; | |
| import { connect } from 'react-redux'; | |
| import { login } from '../../actions/session'; | |
| import LoginForm from '../../components/LoginForm'; | |
| import Navbar from '../../components/Navbar'; | |
| type Props = { | |
| login: () => void, | |
| } |
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
| // @flow | |
| import React, { Component, PropTypes } from 'react'; | |
| import { connect } from 'react-redux'; | |
| import { signup } from '../../actions/session'; | |
| import SignupForm from '../../components/SignupForm'; | |
| import Navbar from '../../components/Navbar'; | |
| type Props = { | |
| signup: () => void, | |
| } |
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
| // @flow | |
| import React, { Component } from 'react'; | |
| import { BrowserRouter, Match, Miss } from 'react-router'; | |
| import Home from '../Home'; | |
| import NotFound from '../../components/NotFound'; | |
| import Login from '../Login'; | |
| import Signup from '../Signup'; | |
| class App extends Component { | |
| render() { |