index.js 1.26 KB
import React, { useEffect } from "react";
import { useDispatch } from "react-redux";
import Reviews from "../../../components/admin/Reviews";
import Layout from "../../../components/layout/Layout";
import Sidebar from "../../../components/layout/VendorDashboardSidebar";
import { getActivitiesByVendor } from "../../../redux/actions/activityAction";
import { wrapper } from "../../../redux/store";

const ReviewsPage = () => {
  const dispatch = useDispatch();
  useEffect(() => {
    dispatch(getActivitiesByVendor());
  }, []);

  return (
    <div>
      <Layout>
        <div className="sidebarContainer">
          <Sidebar />
          <div className="content">
            <Reviews isVendor={true} />
          </div>
        </div>
      </Layout>
    </div>
  );
};

export default ReviewsPage;

/** For server side rendering */
export const getServerSideProps = wrapper.getServerSideProps(store => async ({ req, query }) => {
  // await store.dispatch(loadUser());
  //   await store.dispatch(getActivitiesByVendor());
  // await store.dispatch(getAllVendors());
  // await store.dispatch(loadUser());
  // await store.dispatch(getActivitiesByVendor());
  // await store.dispatch(getAllCategories());
  // await store.dispatch(getAllSubCategories());
  return {
    props: {}
  };
});