diff --git a/src/actions/SendFormActions.js b/src/actions/SendFormActions.js index bf1fe1a5..39301c7b 100644 --- a/src/actions/SendFormActions.js +++ b/src/actions/SendFormActions.js @@ -1,5 +1,6 @@ /* @flow */ - +import React from 'react'; +import Link from 'components/Link'; import TrezorConnect from 'trezor-connect'; import BigNumber from 'bignumber.js'; import * as ACCOUNT from 'actions/constants/account'; @@ -513,13 +514,12 @@ export const onSend = (): AsyncAction => async (dispatch: Dispatch, getState: Ge // reset form dispatch(init()); - dispatch({ type: NOTIFICATION.ADD, payload: { type: 'success', title: 'Transaction success', - message: `See transaction detail`, + message: See transaction detail, cancelable: true, actions: [], }, diff --git a/src/components/Notification/index.js b/src/components/Notification/index.js index ccd4e1bd..e39e2e5d 100644 --- a/src/components/Notification/index.js +++ b/src/components/Notification/index.js @@ -8,7 +8,7 @@ import colors from 'config/colors'; import { getColor, getIcon } from 'utils/notification'; import Icon from 'components/Icon'; import icons from 'config/icons'; -import { FONT_SIZE, FONT_WEIGHT } from 'config/variables'; +import { FONT_WEIGHT, FONT_SIZE } from 'config/variables'; import * as NotificationActions from 'actions/NotificationActions'; import Loader from 'components/Loader'; @@ -16,7 +16,6 @@ import type { CallbackAction } from 'reducers/NotificationReducer'; import NotificationButton from './components/NotificationButton'; - type Props = { type: string, cancelable?: boolean; @@ -35,7 +34,6 @@ const Wrapper = styled.div` background: ${colors.TEXT_SECONDARY}; padding: 24px 48px 24px 24px; display: flex; - min-height: 90px; flex-direction: row; text-align: left; @@ -73,6 +71,10 @@ const Body = styled.div` `} `; +const Message = styled.div` + font-size: ${FONT_SIZE.SMALLER}; +`; + const Title = styled.div` padding-bottom: 5px; font-weight: ${FONT_WEIGHT.BIGGER}; @@ -85,10 +87,6 @@ const CloseClick = styled.div` padding: 20px 10px 0 0; `; -const Message = styled.div` - font-size: ${FONT_SIZE.SMALLER}; -`; - const StyledIcon = styled(Icon)` position: relative; top: -7px; @@ -148,11 +146,7 @@ const Notification = (props: Props): React$Element => { { props.title } - { props.message && ( - -

{ /* eslint-disable-line */ } - - ) } + { props.message ? {props.message} : '' } @@ -174,10 +168,14 @@ const Notification = (props: Props): React$Element => { }; Notification.propTypes = { + className: PropTypes.string, type: PropTypes.string.isRequired, cancelable: PropTypes.bool, title: PropTypes.string.isRequired, - message: PropTypes.string, + message: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.element, + ]).isRequired, actions: PropTypes.arrayOf(PropTypes.object), close: PropTypes.func, loading: PropTypes.bool, diff --git a/src/components/notifications/Context/components/Action/components/NotificationsGroups/components/Group/index.js b/src/components/notifications/Context/components/Action/components/NotificationsGroups/components/Group/index.js index 9ecd2980..1059dd58 100644 --- a/src/components/notifications/Context/components/Action/components/NotificationsGroups/components/Group/index.js +++ b/src/components/notifications/Context/components/Action/components/NotificationsGroups/components/Group/index.js @@ -33,7 +33,7 @@ const Title = styled.div` `; const StyledNotification = styled(Notification)` - border-bottom: 1px solid ${props => getColor(props.type)}; + border-bottom: 1px solid ${colors.WHITE}; &:last-child { border: 0; diff --git a/src/components/notifications/Context/components/Action/components/NotificationsGroups/index.js b/src/components/notifications/Context/components/Action/components/NotificationsGroups/index.js index f78cfcf9..759d8369 100644 --- a/src/components/notifications/Context/components/Action/components/NotificationsGroups/index.js +++ b/src/components/notifications/Context/components/Action/components/NotificationsGroups/index.js @@ -24,45 +24,45 @@ class NotificationsGroup extends PureComponent { } render() { - const { close } = this.props; - const notifications = [ - { - key: 1, - title: 'this is a title of error notification', - type: 'error', - message: 'this is a message of error notification', - }, - { - key: 2, - title: 'this is a title of warning notification', - type: 'warning', - message: 'this is a message of warning notification', - }, - { - key: 3, - title: 'this is a title of warning notification', - type: 'warning', - message: 'this is a message of warning notification', - }, - { - key: 4, - title: 'this is a title of warning notification sds d', - type: 'warning', - message: 'this is a message of warning notification', - }, - { - key: 5, - title: 'this is a title of warning notification as', - type: 'info', - message: 'this is a message of warning notification', - }, - { - key: 6, - title: 'this is a title of info notification s ', - type: 'info', - message: 'this is a message of info notification', - }, - ]; + const { close, notifications } = this.props; + // const notifications = [ + // { + // key: 1, + // title: 'this is a title of error notification', + // type: 'error', + // message: 'this is a message of error notification', + // }, + // { + // key: 2, + // title: 'this is a title of warning notification', + // type: 'warning', + // message: 'this is a message of warning notification', + // }, + // { + // key: 3, + // title: 'this is a title of warning notification', + // type: 'warning', + // message: 'this is a message of warning notification', + // }, + // { + // key: 4, + // title: 'this is a title of warning notification sds d', + // type: 'warning', + // message: 'this is a message of warning notification', + // }, + // { + // key: 5, + // title: 'this is a title of warning notification as', + // type: 'info', + // message: 'this is a message of warning notification', + // }, + // { + // key: 6, + // title: 'this is a title of info notification s ', + // type: 'info', + // message: 'this is a message of info notification', + // }, + // ]; const notificationGroups = this.groupNotifications(notifications); const sortedNotifications = this.sortByPriority(notificationGroups);