diff --git a/ui/app/pages/token/actionable-message/actionable-message.js b/ui/app/pages/token/actionable-message/actionable-message.js index d74179d11..de136366c 100644 --- a/ui/app/pages/token/actionable-message/actionable-message.js +++ b/ui/app/pages/token/actionable-message/actionable-message.js @@ -3,44 +3,47 @@ import PropTypes from 'prop-types' import classnames from 'classnames' export default function ActionableMessage ({ - shown = true, message = '', - actions = [], + primaryAction = null, + secondaryAction = null, className = '', }) { return ( - shown - ? ( -
-
- {message} +
+
+ {message} +
+
+ {primaryAction && ( +
+ {primaryAction.label}
-
- { - actions.map(({ label, onClick, actionClassName }, index) => ( -
- {label} -
- )) - } + )} + {secondaryAction && ( +
+ {secondaryAction.label}
-
- ) - : null + )} +
+
) } ActionableMessage.propTypes = { - shown: PropTypes.bool, message: PropTypes.string.isRequired, - actions: PropTypes.shape({ + primaryAction: PropTypes.shape({ + label: PropTypes.string, + onClick: PropTypes.func, + }), + secondaryAction: PropTypes.shape({ label: PropTypes.string, onClick: PropTypes.func, - actionClassName: PropTypes.string, }), className: PropTypes.string, } diff --git a/ui/app/pages/token/actionable-message/actionable-message.stories.js b/ui/app/pages/token/actionable-message/actionable-message.stories.js index d39747377..6856ea17f 100644 --- a/ui/app/pages/token/actionable-message/actionable-message.stories.js +++ b/ui/app/pages/token/actionable-message/actionable-message.stories.js @@ -1,6 +1,6 @@ import React from 'react' import { action } from '@storybook/addon-actions' -import { text, boolean } from '@storybook/addon-knobs/react' +import { text } from '@storybook/addon-knobs/react' import ActionableMessage from '.' export default { @@ -10,7 +10,6 @@ export default { export const NoAction = () => (
@@ -19,50 +18,27 @@ export const NoAction = () => ( export const OneAction = () => (
) -export const TwoActionsWithClassNames = () => ( +export const TwoActions = () => (
-
-) - -export const OneActionWithAClass = () => ( -
-
diff --git a/ui/app/pages/token/actionable-message/index.scss b/ui/app/pages/token/actionable-message/index.scss index eabd2001e..6657b5e19 100644 --- a/ui/app/pages/token/actionable-message/index.scss +++ b/ui/app/pages/token/actionable-message/index.scss @@ -27,15 +27,19 @@ font-weight: bold; cursor: pointer; } -} -.actionable-message--warning { - background: $Yellow-100; - border: 1px solid $Yellow-500; - justify-content: center; + &--warning { + background: $Yellow-100; + border: 1px solid $Yellow-500; + justify-content: center; - .actionable-message__message, - .actionable-message__action { - color: $Black-100; + .actionable-message__message, + .actionable-message__action { + color: $Black-100; + } + + .actionable-message__action--secondary { + text-decoration: underline; + } } }