Proyectos de Subversion LeadersLinked - Backend

Rev

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

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