Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3694 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3694 Rev 3719
Línea 1... Línea 1...
1
import React from 'react';
1
import React from 'react';
2
import { useSelector } from 'react-redux';
2
import { useSelector } from 'react-redux';
3
import { styled } from '@mui/material';
3
import { styled } from '@mui/material';
4
 
4
 
5
import AlertComponent from './AlertComponent';
5
import AlertComponent from './AlertComponent';
6
 
6
 
7
const NotificationDiv = styled('div')(({ theme }) => ({
7
const NotificationDiv = styled('div')(({ theme }) => ({
8
  position: 'fixed',
8
  position: 'fixed',
9
  top: '1rem',
9
  top: '1rem',
10
  left: '50%',
10
  left: '50%',
11
  transform: 'translateX(-50%)',
11
  transform: 'translateX(-50%)',
12
  display: 'flex',
12
  display: 'flex',
13
  flexDirection: 'column',
13
  flexDirection: 'column',
14
  gap: theme.spacing(0.5),
14
  gap: theme.spacing(0.5),
15
  justifyContent: 'center',
15
  justifyContent: 'center',
16
  alignItems: 'center',
16
  alignItems: 'center',
17
  zIndex: 2200
17
  zIndex: 2200
18
}));
18
}));
19
 
19
 
20
const NotificationAlert = () => {
20
const NotificationAlert = () => {
21
  const notifications = useSelector(({ notification }) => notification.notifications);
21
  const notifications = useSelector(({ notification }) => notification.notifications);
22
 
22
 
23
  return (
23
  return (
24
    <NotificationDiv>
24
    <NotificationDiv>
25
      {notifications.map((notification) => (
25
      {notifications.map((notification) => (
26
        <AlertComponent notification={notification} key={notification.id} />
26
        <AlertComponent notification={notification} key={notification.id} />
27
      ))}
27
      ))}
28
    </NotificationDiv>
28
    </NotificationDiv>
29
  );
29
  );
30
};
30
};
31
 
31
 
32
export default NotificationAlert;
32
export default NotificationAlert;