index.js
1.01 KB
import React, { useEffect } from "react";
import { useDispatch } from "react-redux";
import Layout from "../../../components/layout/Layout";
import BusinessDetails from "../../../components/vendor/BusinessDetails";
import { loadUser } from "../../../redux/actions/userActions";
import { getVendorDetails } from "../../../redux/actions/vendorActions";
import { wrapper } from "../../../redux/store";
// import { loadUser } from "../redux/actions/userActions";
// import { wrapper } from "../redux/store";
export default function BusinessDetailsPage () {
const dispatch = useDispatch()
useEffect(() => {
dispatch(getVendorDetails())
}, [])
return (
<Layout>
<BusinessDetails />
</Layout>
);
};
/** 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());
return {
props: {}
};
});