From 6dc197f07b3f50e334d3bd613f1e1a8668cc3744 Mon Sep 17 00:00:00 2001 From: mishevong Date: Wed, 24 Mar 2021 16:30:23 -0700 Subject: [PATCH] Fixes #266 - Remove close icon from assets, changed close button to be IconButton from WC, cleaned up stories --- src/components/Banner/Banner.stories.tsx | 19 ++----------------- src/components/Banner/index.tsx | 12 +++++------- src/components/assets/icons/close.svg | 3 --- 3 files changed, 7 insertions(+), 27 deletions(-) delete mode 100644 src/components/assets/icons/close.svg diff --git a/src/components/Banner/Banner.stories.tsx b/src/components/Banner/Banner.stories.tsx index 53209652..6c5aea9d 100644 --- a/src/components/Banner/Banner.stories.tsx +++ b/src/components/Banner/Banner.stories.tsx @@ -18,8 +18,6 @@ const Template: Story = args => export const Error = Template.bind({}) Error.args = { - children: - 'Once we receive an alert we scan it against policy risk rules. The rules are evaluated in order from top to bottom. The first rule that matches determines the risk of the alert. Updating a rule will not impact the past alerts. However you can use past alerts as a reference to edit rules such that future alerts get your desired risk classification.', showIcon: true, title: 'Error', type: error @@ -27,8 +25,6 @@ Error.args = { export const Info = Template.bind({}) Info.args = { - children: - 'Once we receive an alert we scan it against policy risk rules. The rules are evaluated in order from top to bottom. The first rule that matches determines the risk of the alert. Updating a rule will not impact the past alerts. However you can use past alerts as a reference to edit rules such that future alerts get your desired risk classification.', showIcon: true, title: 'Info', type: info @@ -36,8 +32,6 @@ Info.args = { export const Success = Template.bind({}) Success.args = { - children: - 'Once we receive an alert we scan it against policy risk rules. The rules are evaluated in order from top to bottom. The first rule that matches determines the risk of the alert. Updating a rule will not impact the past alerts. However you can use past alerts as a reference to edit rules such that future alerts get your desired risk classification.', showIcon: true, title: 'Success', type: success @@ -45,25 +39,16 @@ Success.args = { export const Warning = Template.bind({}) Warning.args = { - children: - 'Once we receive an alert we scan it against policy risk rules. The rules are evaluated in order from top to bottom. The first rule that matches determines the risk of the alert. Updating a rule will not impact the past alerts. However you can use past alerts as a reference to edit rules such that future alerts get your desired risk classification.', showIcon: true, title: 'Warning', type: warning } -export const NoIcon = Template.bind({}) -NoIcon.args = { +export const NoIconWithChildren = Template.bind({}) +NoIconWithChildren.args = { children: 'Once we receive an alert we scan it against policy risk rules. The rules are evaluated in order from top to bottom. The first rule that matches determines the risk of the alert. Updating a rule will not impact the past alerts. However you can use past alerts as a reference to edit rules such that future alerts get your desired risk classification.', showIcon: false, title: 'Policy Risk Rules', type: success } - -export const NoIconAndChildren = Template.bind({}) -NoIconAndChildren.args = { - showIcon: false, - title: 'Policy Risk Rules', - type: success -} diff --git a/src/components/Banner/index.tsx b/src/components/Banner/index.tsx index 33270eef..c7d6aa16 100644 --- a/src/components/Banner/index.tsx +++ b/src/components/Banner/index.tsx @@ -1,7 +1,7 @@ -import Close from '../assets/icons/close.svg' import cn from 'classnames' import { createUseStyles } from 'react-jss' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import { IconButton } from 'components/IconButton' import { mappedTypesToIcons } from 'components/NotificationV2/utils' import { ev as NotificationTypes } from '@dassana-io/web-utils' import { styleguide } from 'components/assets/styles' @@ -76,12 +76,10 @@ export const Banner: FC = ({ )}
{title}
-
toggleRender()} - > - Close banner -
+
{children}
diff --git a/src/components/assets/icons/close.svg b/src/components/assets/icons/close.svg deleted file mode 100644 index 5d383e16..00000000 --- a/src/components/assets/icons/close.svg +++ /dev/null @@ -1,3 +0,0 @@ - - -