Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 2173 | Rev 3693 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
3692 stevensc 1
import React from 'react';
2
import { useSelector } from 'react-redux';
3
import { styled } from '@mui/material';
2173 stevensc 4
 
3692 stevensc 5
import AlertComponent from './AlertComponent';
5 stevensc 6
 
2173 stevensc 7
const NotificationDiv = styled('div')`
5 stevensc 8
  position: fixed;
9
  top: 1rem;
10
  left: 50%;
11
  transform: translateX(-50%);
12
  display: flex;
13
  flex-direction: column;
14
  justify-content: center;
15
  align-items: center;
2008 stevensc 16
  z-index: 2200;
3692 stevensc 17
`;
5 stevensc 18
const NotificationAlert = () => {
3692 stevensc 19
  const notifications = useSelector(({ notification }) => notification.notifications);
5 stevensc 20
 
21
  return (
22
    <NotificationDiv>
3692 stevensc 23
      <AlertComponent
24
        notification={{
25
          id: '1',
26
          style: 'success',
27
          msg: 'Teste de notificação'
28
        }}
29
      />
30
      <AlertComponent
31
        notification={{
32
          id: '1',
33
          style: 'danger',
34
          msg: 'Teste de notificação'
35
        }}
36
      />
5 stevensc 37
      {notifications.map((notification) => (
38
        <AlertComponent notification={notification} key={notification.id} />
39
      ))}
40
    </NotificationDiv>
3692 stevensc 41
  );
42
};
5 stevensc 43
 
3692 stevensc 44
export default NotificationAlert;