Grégoire Delattre bcadc48d5a Launch prettier with the --fix option
They've changed their default settings, this changes a lot of stuff in
our code base.
2020-04-01 17:55:34 +02:00

35 lines
951 B
JavaScript

import React from "react";
import PropTypes from "prop-types";
import { List } from "immutable";
import { connect } from "react-redux";
import { Notification } from "./notification";
const NotificationsConnected = ({ notifications }) => {
return (
<div className="notifications">
{notifications.map((el) => (
<Notification
key={el.get("id")}
id={el.get("id")}
icon={el.get("icon", "video-camera")}
title={el.get("title", "Notification")}
message={el.get("message")}
autohide={el.get("autohide", true)}
delay={el.get("delay", 10000)}
imageUrl={el.get("imageUrl")}
/>
))}
</div>
);
};
NotificationsConnected.propTypes = {
notifications: PropTypes.instanceOf(List),
};
const mapStateToProps = (state) => ({
notifications: state.notifications,
});
export const Notifications = connect(mapStateToProps)(NotificationsConnected);