Blame view

pages/admin/vendors/index.js 1.6 KB
Jyotsna committed
1 2 3 4
import React from "react";
import Layout from "../../../components/layout/Layout";
import Sidebar from "../../../components/layout/AdminDashboardSidebar";
import VendorListing from "../../../components/admin/VendorListing";
jaymehta committed
5 6 7 8
import { wrapper } from "../../../redux/store";
import { getAllVendors } from "../../../redux/actions/vendorActions";
import { loadUser } from "../../../redux/actions/userActions";
import { getAllCategories, getAllSubCategories } from "../../../redux/actions/categoriesAction";
Chetan committed
9
import { GenericLayout } from "../../../components/layout/Generics/GenericLayout";
Jyotsna committed
10 11

export default function VendorListingPage() {
jaymehta committed
12
  return (
Chetan committed
13 14 15 16 17 18 19 20 21 22
    // <Layout>
    //   <div className="sidebarContainer">
    //     <Sidebar />
    //     <div className="content">
    <GenericLayout>
      <VendorListing />
    </GenericLayout>
    //     </div>
    //   </div>
    // </Layout>
jaymehta committed
23 24
  );
}
Jyotsna committed
25

jaymehta committed
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
/** For server side rendering */
// export const getServerSideProps = wrapper.getServerSideProps(store => async ({ req, query }) => {
//   // Get the menu data.

//   // get the locations data.
//   await store.dispatch(loadUser());
//   await store.dispatch(getAllVendors());

//   return {
//     props: {}
//   };
// });

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