Blame view

pages/vendor/activities/[id].js 1.88 KB
jaymehta committed
1 2
import { Layout } from "antd";
import React from "react";
jaymehta committed
3 4 5 6
// import { ToastContainer } from "react-toastify";
// import "react-toastify/dist/ReactToastify.css";

// import { ToastContainer } from "react-bootstrap";
jaymehta committed
7 8 9 10 11 12 13 14
import Sidebar from "../../../components/layout/VendorDashboardSidebar";
import ActivityDetails from "../../../components/vendor/ActivityDetails";
import ActivityListingRBAC from "../../../components/vendor/ActivityListingRBAC";
import UpdateActivity from "../../../components/vendor/UpdateActivity";
import { getActivitiesByVendor, getActivityById } from "../../../redux/actions/activityAction";
import { getAllCategories, getAllSubCategories } from "../../../redux/actions/categoriesAction";
import { loadUser } from "../../../redux/actions/userActions";
import { wrapper } from "../../../redux/store";
Chetan committed
15
import { GenericLayout } from "../../../components/layout/Generics/GenericLayout";
jaymehta committed
16 17 18

const EditActivityDetail = () => {
  return (
Chetan committed
19 20 21 22 23 24 25 26 27 28 29 30 31 32
    <GenericLayout>
      <ActivityDetails isUpdate={true} />
    </GenericLayout>
    // <Layout>
    //   <ToastContainer position="bottom-right"></ToastContainer>
    //   <div className="sidebarContainer">
    //     <Sidebar />
    //     <div className="content">
    //       <ActivityListingRBAC />
    //       <ActivityDetails isUpdate={true} />
    //       <UpdateActivity />
    //     </div>
    //   </div>
    // </Layout>
jaymehta committed
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
  );
};

export default EditActivityDetail;

/** For server side rendering */
export const getServerSideProps = wrapper.getServerSideProps(store => async ({ req, query }) => {
  // Get the menu data.
  // await store.dispatch(getActivitiesByVendor())
  await store.dispatch(loadUser());
  await store.dispatch(getAllCategories());
  await store.dispatch(getAllSubCategories());
  await store.dispatch(getActivityById(query.id));

  // get the locations data.
  // await store.dispatch(getVendorDetails())

  return {
    props: {}
  };
});