Commit 7fe6a04a by jaymehta

changes

1 parent 0e13ff9f
import Image from 'next/image'; import Image from "next/image";
import { useRouter } from 'next/router'; import { useRouter } from "next/router";
import React, { useState } from 'react'; import React, { useState } from "react";
import { ToastContainer } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
const Sidebar = () => { const Sidebar = () => {
const router = useRouter(); const router = useRouter();
...@@ -12,7 +13,9 @@ const Sidebar = () => { ...@@ -12,7 +13,9 @@ const Sidebar = () => {
}; };
return ( return (
<div className={`sidebar ${collapsed ? 'collapsed' : ''}`}> <div className={`sidebar ${collapsed ? "collapsed" : ""}`}>
<ToastContainer position="bottom-right"></ToastContainer>
{/* <button className="toggle-btn" onClick={toggleSidebar}> {/* <button className="toggle-btn" onClick={toggleSidebar}>
Toggle Sidebar Toggle Sidebar
</button> */} </button> */}
......
...@@ -124,8 +124,7 @@ const monthsArray = [ ...@@ -124,8 +124,7 @@ const monthsArray = [
// import { colourOptions } from '../data'; // import { colourOptions } from '../data';
const animatedComponents = makeAnimated(); const animatedComponents = makeAnimated();
const ActivityDetails = ({ isUpdate }) => { const ActivityDetails = ({ isUpdate }) => {
const ActivityApprovalStatus = ({ status }) => {
const ActivityApprovalStatus = ({ status }) => {
if (status) { if (status) {
switch (status) { switch (status) {
case true: case true:
...@@ -167,7 +166,7 @@ const ActivityApprovalStatus = ({ status }) => { ...@@ -167,7 +166,7 @@ const ActivityApprovalStatus = ({ status }) => {
break; break;
} }
} }
}; };
const dispatch = useDispatch(); const dispatch = useDispatch();
const { categories } = useSelector(state => state.categories); const { categories } = useSelector(state => state.categories);
const { subCategories } = useSelector(state => state.subCategories); const { subCategories } = useSelector(state => state.subCategories);
...@@ -335,25 +334,11 @@ const ActivityApprovalStatus = ({ status }) => { ...@@ -335,25 +334,11 @@ const ActivityApprovalStatus = ({ status }) => {
} }
let fromDate; let fromDate;
let toDate; let toDate;
console.log("timeslots", activityPeriodState); console.log("timeslots", activityPeriodState, startDate, endDate);
if (!startDate || !endDate) { if (!startDate || !endDate) {
fromDate = sanitizeTimeRange({ data: activityPeriodState[0] }); fromDate = sanitizeTimeRange({ data: activityPeriodState[0] });
toDate = sanitizeTimeRange({ data: activityPeriodState[1] }); toDate = sanitizeTimeRange({ data: activityPeriodState[1] });
if (!activityPeriodState || !activityPeriodState.length > 0) { if (!activityPeriodState || !activityPeriodState.length > 0) {
// let timeSlots = [];
// timeSlots = timeArray.map(item => {
// console.log("sanitizeTimeFormat({ data: item })", sanitizeTimeFormat({ data: item }));
// if (!sanitizeTimeFormat({ data: item })) {
// console.log("sanitize 1", sanitizeTimeFormat({ data: item }));
// toast.error("Time slots can not be empty!");
// setTimeSlotError(true);
// return;
// }
// console.log("sanitize 2", sanitizeTimeFormat({ data: item }));
// timeSlots = [...timeSlots, sanitizeTimeFormat({ data: item })];
// return sanitizeTimeFormat({ data: item });
// });
toast.error("Please select time range"); toast.error("Please select time range");
return; return;
} }
...@@ -1054,9 +1039,12 @@ const ActivityApprovalStatus = ({ status }) => { ...@@ -1054,9 +1039,12 @@ const ActivityApprovalStatus = ({ status }) => {
</div> </div>
<div className="col-6 col-lg-5"> <div className="col-6 col-lg-5">
<div className="input-group"> <div className="input-group">
<Button onClick={()=> { <Button
router.push("/vendor/activities") onClick={() => {
}} className="btn btn-primary btn-submit"> router.push("/vendor/activities");
}}
className="btn btn-primary btn-submit"
>
See all activities See all activities
</Button> </Button>
</div> </div>
......
import { Layout } from "antd"; import { Layout } from "antd";
import React from "react"; import React from "react";
// import { ToastContainer } from "react-toastify";
// import "react-toastify/dist/ReactToastify.css";
// import { ToastContainer } from "react-bootstrap";
import Sidebar from "../../../components/layout/VendorDashboardSidebar"; import Sidebar from "../../../components/layout/VendorDashboardSidebar";
import ActivityDetails from "../../../components/vendor/ActivityDetails"; import ActivityDetails from "../../../components/vendor/ActivityDetails";
import ActivityListingRBAC from "../../../components/vendor/ActivityListingRBAC"; import ActivityListingRBAC from "../../../components/vendor/ActivityListingRBAC";
...@@ -12,6 +16,8 @@ import { wrapper } from "../../../redux/store"; ...@@ -12,6 +16,8 @@ import { wrapper } from "../../../redux/store";
const EditActivityDetail = () => { const EditActivityDetail = () => {
return ( return (
<Layout> <Layout>
{/* <ToastContainer position="bottom-right"></ToastContainer> */}
<div className="sidebarContainer"> <div className="sidebarContainer">
<Sidebar /> <Sidebar />
<div className="content"> <div className="content">
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!