Blame view

pages/index.js 736 Bytes
jay committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
import Home from "../components/home/Home";
import Layout from "../components/layout/Layout";
import { wrapper } from "../redux/store";

export default function IndexPage() {
  /** Client side rendering, traditional API call. */
  // const dispatch = useDispatch();
  // useEffect(() => {
  //   const fetchData = async () => {
  //     await dispatch(getProjects({ currentPage: 1, featuredOnHome: true }));
  //   };
  //   fetchData();
  // });

  return (
    <Layout>
      <Home />
    </Layout>
  );
}

/** For server side rendering */
23
export const getServerSideProps = wrapper.getServerSideProps(store => async ({ req, query }) => {
jay committed
24 25 26 27 28 29
  // Get the menu data.

  // get the locations data.


  return {
Ravindra Kanojiya committed
30 31
    props: {},
    
jay committed
32 33
  };
});