MyCrypto/common/containers/TabSection/Notifications.tsx
James Prado 9cac0298a2 Improve accessibility (a11y) (#1267)
* Manage modal focus

* Add isOpen prop to CustomNodeModal

* Remove outline overrides

* Update outline style for inputs

* Fix modal focus management & Cleanup CustomNodeModal

* Add aria-label on modal close button

* Fix modal scroll to top

* Add aria-live property for notifications

* Add aria-busy to Spinner component

* Fix border styles for generatewallet password inputs

* Update token balances inputs

* Remove multiple h1's & Update styles

* Add alt text to all img elements

* Update swap link from bity to shapeshift

* Update aria-labels and alt text

* Only show keystore password input when required

* Revert "Only show keystore password input when required"

This reverts commit 7ec5de52da0982cd3131f365b142f6915638d831.

* address changes requested
2018-03-08 13:28:43 -06:00

35 lines
1.1 KiB
TypeScript

import { closeNotification, Notification, TCloseNotification } from 'actions/notifications';
import React from 'react';
import { connect } from 'react-redux';
import { TransitionGroup, CSSTransition } from 'react-transition-group';
import NotificationRow from './NotificationRow';
import './Notifications.scss';
import { AppState } from 'reducers';
interface Props {
notifications: Notification[];
closeNotification: TCloseNotification;
}
export class Notifications extends React.Component<Props, {}> {
public render() {
return (
<TransitionGroup className="Notifications" aria-live="polite">
{this.props.notifications.map(n => {
return (
<CSSTransition classNames="NotificationAnimation" timeout={500} key={n.id}>
<NotificationRow notification={n} onClose={this.props.closeNotification} />
</CSSTransition>
);
})}
</TransitionGroup>
);
}
}
const mapStateToProps = (state: AppState) => ({
notifications: state.notifications
});
export default connect(mapStateToProps, { closeNotification })(Notifications);