mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-10 11:05:47 +00:00
2075a416ae
* Add disclaimer modal to footer * Remove duplicate code & unnecessary styles * Fix formatting noise * remove un-used css style * Fix tslint error & add media query for modals * Nest Media Query * Add react-transition-group * Animate notifications with react-transition-group * Identify issue with notifications getting overridden * Update RTG (react-transition-group) to v2 & identify keys as animation issue * Add unique id on successful transactions for unique keys * update classNames, remove unused import * Revert removing lodash * Remove unnecessary test util * Remove formatting noise * Remove all formatting noise * Update CSS & Change notification unique id * Add unique id for each notification
49 lines
1.2 KiB
TypeScript
49 lines
1.2 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';
|
|
|
|
interface Props {
|
|
notifications: Notification[];
|
|
closeNotification: TCloseNotification;
|
|
}
|
|
|
|
const Transition = props => (
|
|
<CSSTransition
|
|
{...props}
|
|
classNames="NotificationAnimation"
|
|
timeout={{ enter: 500, exit: 500 }}
|
|
/>
|
|
);
|
|
|
|
export class Notifications extends React.Component<Props, {}> {
|
|
public render() {
|
|
return (
|
|
<TransitionGroup className="Notifications">
|
|
{this.props.notifications.map(n => {
|
|
return (
|
|
<Transition key={n.id}>
|
|
<NotificationRow
|
|
notification={n}
|
|
onClose={this.props.closeNotification}
|
|
/>
|
|
</Transition>
|
|
);
|
|
})}
|
|
</TransitionGroup>
|
|
);
|
|
}
|
|
}
|
|
|
|
const mapStateToProps = state => ({
|
|
notifications: state.notifications
|
|
});
|
|
|
|
export default connect(mapStateToProps, { closeNotification })(Notifications);
|