Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
3783 stevensc 1
/* eslint-disable react/prop-types */
1 www 2
import React from "react";
3
import { connect } from "react-redux";
4
import styled from "styled-components";
5
import AlertComponent from "./AlertComponent";
6
 
7
const NotificationDiv = styled.div`
8
  position: fixed;
9
  top: 1rem;
10
  left: 50%;
11
  transform: translateX(-50%);
12
  /* width: 80vw; */
13
  display: flex;
14
  flex-direction: column;
15
  justify-content: center;
16
  align-items: center;
17
  z-index: 1100;
18
`;
19
const NotificationAlert = (props) => {
20
  // redux destructuring
21
  const { notifications } = props;
22
  return (
23
    <NotificationDiv>
24
      {notifications.map((notification) => {
25
        return (
26
          <AlertComponent notification={notification} key={notification.id} />
27
        );
28
      })}
29
    </NotificationDiv>
30
  );
31
};
32
 
33
const mapStateToProps = (state) => ({
34
  notifications: state.notification.notifications,
35
});
36
 
37
// const mapDispatchToProps = {
38
// };
39
 
40
export default connect(mapStateToProps)(NotificationAlert);