Skip to content

Commit

Permalink
fix: processing notification close button visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
navinkarkera committed Oct 2, 2024
1 parent 17e0662 commit dbd4c1e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
.processing-notification-icon {
animation: rotate 1s linear infinite;
}

.processing-notification-hide-close-button {
.btn-icon {
display: none;
}
}
10 changes: 8 additions & 2 deletions src/generic/processing-notification/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ import {
} from '@openedx/paragon';
import { Settings as IconSettings } from '@openedx/paragon/icons';
import { capitalize } from 'lodash';
import classNames from 'classnames';

const ProcessingNotification = ({
isShow, title, action, close,
}) => (
<Toast
className={classNames({ 'processing-notification-hide-close-button': !close })}
show={isShow}
aria-hidden={isShow}
action={action && { ...action }}
onClose={close}
onClose={close || (() => {})}
>
<span className="d-flex align-items-center">
<Icon className="processing-notification-icon mb-0 mr-2" src={IconSettings} />
Expand All @@ -21,14 +23,18 @@ const ProcessingNotification = ({
</Toast>
);

ProcessingNotification.defaultProps = {
close: null,
};

ProcessingNotification.propTypes = {
isShow: PropTypes.bool.isRequired,
title: PropTypes.string.isRequired,
action: PropTypes.shape({
label: PropTypes.string.isRequired,
onClick: PropTypes.func,
}),
close: PropTypes.func.isRequired,
close: PropTypes.func,
};

export default ProcessingNotification;

0 comments on commit dbd4c1e

Please sign in to comment.