Blame view

pages/vendor/business-details/index.js 1.09 KB
jaymehta committed
1 2
import React, { useEffect } from "react";
import { useDispatch } from "react-redux";
3 4
import Layout from "../../../components/layout/Layout";
import BusinessDetails from "../../../components/vendor/BusinessDetails";
jaymehta committed
5 6 7
import { loadUser } from "../../../redux/actions/userActions";
import { getVendorDetails } from "../../../redux/actions/vendorActions";
import { wrapper } from "../../../redux/store";
Chetan committed
8
import { GenericLayout } from "../../../components/layout/Generics/GenericLayout";
jaymehta committed
9 10
// import { loadUser } from "../redux/actions/userActions";
// import { wrapper } from "../redux/store";
11

jaymehta committed
12 13 14 15 16 17 18
export default function BusinessDetailsPage() {
  const dispatch = useDispatch();
  useEffect(() => {
    dispatch(getVendorDetails());
  }, []);

  return (
Chetan committed
19 20
    // <Layout>
    <GenericLayout> 
jaymehta committed
21
      <BusinessDetails />
Chetan committed
22 23
    </GenericLayout> 
    //  </Layout> 
jaymehta committed
24 25
  );
}
jaymehta committed
26 27 28

/** For server side rendering */
export const getServerSideProps = wrapper.getServerSideProps(store => async ({ req, query }) => {
jaymehta committed
29 30 31 32 33 34 35 36 37
  // Get the menu data.

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

  return {
    props: {}
  };
});