|
@@ -9,7 +9,7 @@ import './reviews.scss';
|
|
import Sidebar from '../../components/sidebar/Sidebar';
|
|
import Sidebar from '../../components/sidebar/Sidebar';
|
|
import Footer from '../../components/footer/Footer';
|
|
import Footer from '../../components/footer/Footer';
|
|
import ReviewForm from '../../components/review-form/ReviewForm';
|
|
import ReviewForm from '../../components/review-form/ReviewForm';
|
|
-//import FiltersEvents from '../../components/filtersEvents/FiltersEvents';
|
|
|
|
|
|
+import FiltersReviews from '../../components/filtersReviews/filtersReviews';
|
|
|
|
|
|
export class Reviews extends React.Component {
|
|
export class Reviews extends React.Component {
|
|
componentDidMount() {
|
|
componentDidMount() {
|
|
@@ -18,7 +18,7 @@ export class Reviews extends React.Component {
|
|
}
|
|
}
|
|
|
|
|
|
render() {
|
|
render() {
|
|
- const { postReviewSubmit, events, reviews } = this.props;
|
|
|
|
|
|
+ const { postReviewSubmit, events, reviews, getAllReviews } = this.props;
|
|
const eventsArr = events.map(event => ({
|
|
const eventsArr = events.map(event => ({
|
|
title: event.title,
|
|
title: event.title,
|
|
id: event._id
|
|
id: event._id
|
|
@@ -34,14 +34,14 @@ export class Reviews extends React.Component {
|
|
</div>
|
|
</div>
|
|
<div className="container-wrap">
|
|
<div className="container-wrap">
|
|
|
|
|
|
- {/*<div className="events-filters">
|
|
|
|
|
|
+ <div className="events-filters">
|
|
<h4>Events filter</h4>
|
|
<h4>Events filter</h4>
|
|
- <FiltersEvents labelType="Event Title" getRequest={getAllEvents} eventTypes={eventTypes} />
|
|
|
|
- </div>*/}
|
|
|
|
|
|
+ <FiltersReviews labelType="Event Title" getRequest={getAllReviews} eventTypes={eventsArr} />
|
|
|
|
+ </div>
|
|
|
|
|
|
<div className="reviews-wrap">
|
|
<div className="reviews-wrap">
|
|
{
|
|
{
|
|
- Array.from(reviews).reverse().map((reviewer, ind) => ind < 10 &&
|
|
|
|
|
|
+ reviews.length !== 0 ? Array.from(reviews).reverse().map((reviewer, ind) => ind < 10 &&
|
|
<div className="reviews-item" key={ind}>
|
|
<div className="reviews-item" key={ind}>
|
|
<div className="review-content">
|
|
<div className="review-content">
|
|
<div className="reviews-name">{reviewer.name}</div>
|
|
<div className="reviews-name">{reviewer.name}</div>
|
|
@@ -52,7 +52,7 @@ export class Reviews extends React.Component {
|
|
<div className="reviews-text">{reviewer.text}</div>
|
|
<div className="reviews-text">{reviewer.text}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- )
|
|
|
|
|
|
+ ) : <p className="not-found">Not found feedback</p>
|
|
}
|
|
}
|
|
</div>
|
|
</div>
|
|
<div className="reviews-wrap-add">
|
|
<div className="reviews-wrap-add">
|