[id].js 705 Bytes
import React from "react";
import Detail from "../../components/detail/Detail";
import Layout from "../../components/layout/Layout";
import { getActivitiesByFilters, getActivityById } from "../../redux/actions/activityAction";
import { wrapper } from "../../redux/store";

const ActivityDetailPage = () => {
  return (
    <Layout>
      <Detail />
    </Layout>
  );
};

export default ActivityDetailPage;

/** For server side rendering */
export const getServerSideProps = wrapper.getServerSideProps(store => async ({ req, query }) => {
  
  await store.dispatch(getActivityById(query.id))
//   await store.dispatch(getActivitiesByFilters({category: query.category}))

  return {
    props: {}
  };
});