Skip to content

Commit

Permalink
CompanyAdded message display company name: fix redpelicans#38.
Browse files Browse the repository at this point in the history
+ message duration is longer than before.
  • Loading branch information
Matthias LECONTE authored and Sofiane KHATIR committed Mar 16, 2017
1 parent 837ad54 commit 26504fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
16 changes: 8 additions & 8 deletions src/client/components/App/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { PropTypes } from 'react';
import React from 'react';
import { bindActionCreators } from 'redux';
import { withRouter, Switch, Route } from 'react-router-dom';
import R from 'ramda';
import { connect } from 'react-redux';
import { Layout, notification } from 'antd';
import styled from 'styled-components';
Expand All @@ -27,6 +26,9 @@ export const MainWrapper = styled.section`
min-height: calc(100vh - 112px)
`;

/* https://ant.design/components/notification/#API */
notification.config({ duration: 5 });

const openNotification = ({ type = 'error', message = '', description = '' }) => {
notification[type]({ message, description });
};
Expand All @@ -40,7 +42,7 @@ export class App extends React.Component {
}

render() {
const { user, history, logout } = this.props;
const { user, history, logout } = this.props; // eslint-disable-line
const handleClick = () => history.push(`/people/${user._id}`);
const handleLogout = () => logout();
const makeAuthRoute = route => (props) => {
Expand All @@ -49,11 +51,9 @@ export class App extends React.Component {
<Auth redirect>
<route.component {...props} />
</Auth>
)
}
else {
return <route.component {...props} />
);
}
return (<route.component {...props} />);
};
return (
<Layout>
Expand Down Expand Up @@ -86,7 +86,7 @@ App.propTypes = {
history: React.PropTypes.object.isRequired,
};

const mapStateToProps = state => ({
const mapStateToProps = state => ({
message: state.message,
user: state.login.user,
});
Expand Down
3 changes: 1 addition & 2 deletions src/client/reducers/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ const message = (state = {}, action) => {
return {
id: (id += 1),
type: 'success',
message: 'Successful completion',
description: 'Your company has been added.',
message: `Company '${payload.name}' added`,
};
default:
return state;
Expand Down

0 comments on commit 26504fd

Please sign in to comment.