From e1d4faddfc69ab937357b16fab389c4a6e61ddb3 Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Wed, 29 Aug 2018 13:07:37 +0200 Subject: [PATCH] Finalized notification icon styles --- src/components/Notification/index.js | 33 ++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/src/components/Notification/index.js b/src/components/Notification/index.js index a5948548..eb5e6e4b 100644 --- a/src/components/Notification/index.js +++ b/src/components/Notification/index.js @@ -98,6 +98,28 @@ export const Notification = (props: NProps): React$Element => { return color; }; + const getIconColor = (type) => { + let color; + switch (type) { + case 'info': + color = colors.INFO_PRIMARY; + break; + case 'error': + color = colors.ERROR_PRIMARY; + break; + case 'warning': + color = colors.WARNING_PRIMARY; + break; + case 'success': + color = colors.SUCCESS_PRIMARY; + break; + default: + color = null; + } + + return color; + }; + return ( {props.loading && } @@ -108,7 +130,10 @@ export const Notification = (props: NProps): React$Element => { )} - + { props.title } @@ -136,7 +161,7 @@ export const Notification = (props: NProps): React$Element => { ); }; -export const NotificationGroup = (props: Props) => { +export const NotificationGroup = (props) => { const { notifications, close } = props; return notifications.map((n, i) => ( { }; export default connect( - (state: State) => ({ + state => ({ notifications: state.notifications, }), - (dispatch: Dispatch) => ({ + dispatch => ({ close: bindActionCreators(NotificationActions.close, dispatch), }), )(NotificationGroup); \ No newline at end of file