2022-09-08 14:46:04 +03:00

36 lines
739 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React from "react";
import Link from "next/link";
import NotificationMessage from "../../Events/NotificationMessage";
export default class NotificationsList extends React.Component
{
constructor(props)
{
super(props);
this.state = {
};
}
render()
{
const { events } = this.props;
let limit = 5;
if (typeof window !== "undefined")
{
limit = window.innerWidth > 768 ? 5 : 3;
}
return (
<>
<ul className="list">
{ events !== undefined && events !== null && events.slice(0, limit).map((event, index) => <NotificationMessage event={ event } key={ index } { ...this.props }/>) }
</ul>
<Link href="/events">
<a className="all">Все события</a>
</Link>
</>
)
}
}