Login workflow (#137)
* Use collection label instead of name on the CollectionPage * Added Avatar and logout menu item * [feat](login) Added userpic with a logout action in the dropdown. - Display logged in user in the AppHeader - Implemented logout action and store + tests - Better styles for GitHub sign in screen Closes #100 * Better styles for the AppHeader
This commit is contained in:
committed by
Cássio Souza
parent
1c4751f479
commit
4d696f2253
@ -8,7 +8,7 @@ import { Link } from 'react-toolbox/lib/link';
|
||||
import { Notifs } from 'redux-notifications';
|
||||
import TopBarProgress from 'react-topbar-progress-indicator';
|
||||
import { loadConfig } from '../actions/config';
|
||||
import { loginUser } from '../actions/auth';
|
||||
import { loginUser, logoutUser } from '../actions/auth';
|
||||
import { currentBackend } from '../backends/backend';
|
||||
import {
|
||||
SHOW_COLLECTION,
|
||||
@ -40,6 +40,7 @@ class App extends React.Component {
|
||||
config: ImmutablePropTypes.map,
|
||||
collections: ImmutablePropTypes.orderedMap,
|
||||
createNewEntryInCollection: PropTypes.func.isRequired,
|
||||
logoutUser: PropTypes.func.isRequired,
|
||||
dispatch: PropTypes.func.isRequired,
|
||||
navigateToCollection: PropTypes.func.isRequired,
|
||||
user: ImmutablePropTypes.map,
|
||||
@ -138,6 +139,7 @@ class App extends React.Component {
|
||||
runCommand,
|
||||
navigateToCollection,
|
||||
createNewEntryInCollection,
|
||||
logoutUser,
|
||||
isFetching,
|
||||
} = this.props;
|
||||
|
||||
@ -189,11 +191,13 @@ class App extends React.Component {
|
||||
</nav>
|
||||
</NavDrawer>
|
||||
<AppHeader
|
||||
user={user}
|
||||
collections={collections}
|
||||
commands={commands}
|
||||
defaultCommands={defaultCommands}
|
||||
runCommand={runCommand}
|
||||
onCreateEntryClick={createNewEntryInCollection}
|
||||
onLogoutClick={logoutUser}
|
||||
toggleNavDrawer={this.toggleNavDrawer}
|
||||
/>
|
||||
<Panel scrollY>
|
||||
@ -226,6 +230,9 @@ function mapDispatchToProps(dispatch) {
|
||||
createNewEntryInCollection: (collectionName) => {
|
||||
dispatch(createNewEntryInCollection(collectionName));
|
||||
},
|
||||
logoutUser: () => {
|
||||
dispatch(logoutUser());
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user