Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3692 | Rev 3694 | 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
 
3693 stevensc 7
const NotificationDiv = styled('div')(({ theme }) => ({
8
  position: 'fixed',
9
  top: '1rem',
10
  left: '50%',
11
  transform: 'translateX(-50%)',
12
  display: 'flex',
13
  flexDirection: 'column',
14
  gap: theme.spacing(0.5),
15
  justifyContent: 'center',
16
  alignItems: 'center',
17
  zIndex: 2200
18
}));
19
 
5 stevensc 20
const NotificationAlert = () => {
3692 stevensc 21
  const notifications = useSelector(({ notification }) => notification.notifications);
5 stevensc 22
 
23
  return (
24
    <NotificationDiv>
3692 stevensc 25
      <AlertComponent
26
        notification={{
27
          id: '1',
28
          style: 'success',
29
          msg: 'Teste de notificação'
30
        }}
31
      />
32
      <AlertComponent
33
        notification={{
34
          id: '1',
35
          style: 'danger',
36
          msg: 'Teste de notificação'
37
        }}
38
      />
5 stevensc 39
      {notifications.map((notification) => (
40
        <AlertComponent notification={notification} key={notification.id} />
41
      ))}
42
    </NotificationDiv>
3692 stevensc 43
  );
44
};
5 stevensc 45
 
3692 stevensc 46
export default NotificationAlert;