Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 6512 | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |

import React from 'react'
import { useSelector } from 'react-redux'
import styled from 'styled-components'
import AlertComponent from './AlertComponent'

const NotificationDiv = styled.div`
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1200;
`
const NotificationAlert = () => {
  const notifications = useSelector(
    ({ notification }) => notification.notifications
  )

  return (
    <NotificationDiv>
      {notifications.map((notification) => (
        <AlertComponent notification={notification} key={notification.id} />
      ))}
    </NotificationDiv>
  )
}

export default NotificationAlert