Commit a3148dbd by jaymehta

listing and detail

1 parent 87175bba
...@@ -2,16 +2,15 @@ import React, { useEffect, useRef, useState } from "react"; ...@@ -2,16 +2,15 @@ import React, { useEffect, useRef, useState } from "react";
import { Button, Input, Space, Table } from "antd"; import { Button, Input, Space, Table } from "antd";
import { useSelector } from "react-redux"; import { useSelector } from "react-redux";
import Highlighter from "react-highlight-words"; import Highlighter from "react-highlight-words";
import { SearchOutlined } from "@ant-design/icons"; import { DeleteTwoTone, EditTwoTone, SearchOutlined } from "@ant-design/icons";
import { useRouter } from "next/router";
const onChange = (pagination, filters, sorter, extra) => { const onChange = (pagination, filters, sorter, extra) => {
console.log("params", pagination, filters, sorter, extra); console.log("params", pagination, filters, sorter, extra);
}; };
export const ActivityListingRBAC = () => { export const ActivityListingRBAC = () => {
const router = useRouter()
// let columns = [] // let columns = []
// useSelectors // useSelectors
const { allActivitiesData } = useSelector(state => state.allActivitiesData); const { allActivitiesData } = useSelector(state => state.allActivitiesData);
...@@ -23,8 +22,8 @@ export const ActivityListingRBAC = () => { ...@@ -23,8 +22,8 @@ export const ActivityListingRBAC = () => {
const [columns, setcolumns] = useState([]); const [columns, setcolumns] = useState([]);
const [data, setdata] = useState([]); const [data, setdata] = useState([]);
const [searchText, setSearchText] = useState(''); const [searchText, setSearchText] = useState("");
const [searchedColumn, setSearchedColumn] = useState(''); const [searchedColumn, setSearchedColumn] = useState("");
// functions // functions
const onSelectChange = newSelectedRowKeys => { const onSelectChange = newSelectedRowKeys => {
...@@ -38,27 +37,27 @@ export const ActivityListingRBAC = () => { ...@@ -38,27 +37,27 @@ export const ActivityListingRBAC = () => {
setSearchText(selectedKeys[0]); setSearchText(selectedKeys[0]);
setSearchedColumn(dataIndex); setSearchedColumn(dataIndex);
}; };
const handleReset = (clearFilters) => { const handleReset = clearFilters => {
clearFilters(); clearFilters();
setSearchText(''); setSearchText("");
}; };
const getColumnSearchProps = (dataIndex) => ({ const getColumnSearchProps = dataIndex => ({
filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters, close }) => ( filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters, close }) => (
<div <div
style={{ style={{
padding: 8, padding: 8
}} }}
onKeyDown={(e) => e.stopPropagation()} onKeyDown={e => e.stopPropagation()}
> >
<Input <Input
ref={searchInput} ref={searchInput}
placeholder={`Search ${dataIndex}`} placeholder={`Search ${dataIndex}`}
value={selectedKeys[0]} value={selectedKeys[0]}
onChange={(e) => setSelectedKeys(e.target.value ? [e.target.value] : [])} onChange={e => setSelectedKeys(e.target.value ? [e.target.value] : [])}
onPressEnter={() => handleSearch(selectedKeys, confirm, dataIndex)} onPressEnter={() => handleSearch(selectedKeys, confirm, dataIndex)}
style={{ style={{
marginBottom: 8, marginBottom: 8,
display: 'block', display: "block"
}} }}
/> />
<Space> <Space>
...@@ -68,7 +67,7 @@ export const ActivityListingRBAC = () => { ...@@ -68,7 +67,7 @@ export const ActivityListingRBAC = () => {
icon={<SearchOutlined />} icon={<SearchOutlined />}
size="small" size="small"
style={{ style={{
width: 90, width: 90
}} }}
> >
Search Search
...@@ -77,7 +76,7 @@ export const ActivityListingRBAC = () => { ...@@ -77,7 +76,7 @@ export const ActivityListingRBAC = () => {
onClick={() => clearFilters && handleReset(clearFilters)} onClick={() => clearFilters && handleReset(clearFilters)}
size="small" size="small"
style={{ style={{
width: 90, width: 90
}} }}
> >
Reset Reset
...@@ -87,7 +86,7 @@ export const ActivityListingRBAC = () => { ...@@ -87,7 +86,7 @@ export const ActivityListingRBAC = () => {
size="small" size="small"
onClick={() => { onClick={() => {
confirm({ confirm({
closeDropdown: false, closeDropdown: false
}); });
setSearchText(selectedKeys[0]); setSearchText(selectedKeys[0]);
setSearchedColumn(dataIndex); setSearchedColumn(dataIndex);
...@@ -107,34 +106,33 @@ export const ActivityListingRBAC = () => { ...@@ -107,34 +106,33 @@ export const ActivityListingRBAC = () => {
</Space> </Space>
</div> </div>
), ),
filterIcon: (filtered) => ( filterIcon: filtered => (
<SearchOutlined <SearchOutlined
style={{ style={{
color: filtered ? '#1677ff' : undefined, color: filtered ? "#1677ff" : undefined
}} }}
/> />
), ),
onFilter: (value, record) => onFilter: (value, record) => record[dataIndex].toString().toLowerCase().includes(value.toLowerCase()),
record[dataIndex].toString().toLowerCase().includes(value.toLowerCase()), onFilterDropdownOpenChange: visible => {
onFilterDropdownOpenChange: (visible) => {
if (visible) { if (visible) {
setTimeout(() => searchInput.current?.select(), 100); setTimeout(() => searchInput.current?.select(), 100);
} }
}, },
render: (text) => render: text =>
searchedColumn === dataIndex ? ( searchedColumn === dataIndex ? (
<Highlighter <Highlighter
highlightStyle={{ highlightStyle={{
backgroundColor: '#ffc069', backgroundColor: "#ffc069",
padding: 0, padding: 0
}} }}
searchWords={[searchText]} searchWords={[searchText]}
autoEscape autoEscape
textToHighlight={text ? text.toString() : ''} textToHighlight={text ? text.toString() : ""}
/> />
) : ( ) : (
text text
), )
}); });
// useEffects // useEffects
...@@ -183,7 +181,7 @@ export const ActivityListingRBAC = () => { ...@@ -183,7 +181,7 @@ export const ActivityListingRBAC = () => {
title: "Name", title: "Name",
dataIndex: "name", dataIndex: "name",
key: "name", key: "name",
...getColumnSearchProps('name'), ...getColumnSearchProps("name"),
width: "15%" width: "15%"
}, },
{ {
...@@ -237,24 +235,45 @@ export const ActivityListingRBAC = () => { ...@@ -237,24 +235,45 @@ export const ActivityListingRBAC = () => {
// ], // ],
// onFilter: (value, record) => record.address.startsWith(value), // onFilter: (value, record) => record.address.startsWith(value),
// filterSearch: true, // filterSearch: true,
width: "15%" width: "15%"
}, },
// {
// title: "Gift",
// dataIndex: "gift",
// // filters: [
// // {
// // text: "London",
// // value: "London"
// // },
// // {
// // text: "New York",
// // value: "New York"
// // }
// // ],
// // onFilter: (value, record) => record.address.startsWith(value),
// // filterSearch: true,
// width: "10%"
// },
{ {
title: "Gift", title: "Edit record",
dataIndex: "gift", render: (_, record) => (
// filters: [ <Space size="middle">
// { {/* <a>Invite {record.name}</a> */}
// text: "London", <EditTwoTone style={{ fontSize: "22px" }}
// value: "London" onClick={() => {
// }, router.push(`/vendor/activities/${record.key}`)
// { console.log(record);
// text: "New York", }}/>
// value: "New York" {/* <DeleteTwoTone
// } twoToneColor="#FF0000"
// ], style={{ fontSize: "22px" }}
// onFilter: (value, record) => record.address.startsWith(value), onClick={() => {
// filterSearch: true, console.log(record);
}}
/> */}
</Space>
),
width: "10%" width: "10%"
} }
]); ]);
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
"@stripe/stripe-js": "^1.35.0", "@stripe/stripe-js": "^1.35.0",
"antd": "^5.15.3", "antd": "^5.15.3",
"axios": "^0.27.2", "axios": "^0.27.2",
"dayjs": "^1.11.10",
"easyinvoice": "^2.3.3", "easyinvoice": "^2.3.3",
"formik": "^2.2.9", "formik": "^2.2.9",
"framer-motion": "^11.0.14", "framer-motion": "^11.0.14",
...@@ -30,6 +31,7 @@ ...@@ -30,6 +31,7 @@
"react-icons": "^5.0.1", "react-icons": "^5.0.1",
"react-image-gallery": "^1.3.0", "react-image-gallery": "^1.3.0",
"react-js-pagination": "^3.0.3", "react-js-pagination": "^3.0.3",
"react-lazyload": "^3.2.1",
"react-loading-icons": "^1.1.0", "react-loading-icons": "^1.1.0",
"react-multi-carousel": "^2.8.2", "react-multi-carousel": "^2.8.2",
"react-otp-input": "^3.1.1", "react-otp-input": "^3.1.1",
......
import { Layout } from "antd";
import React from "react";
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";
const EditActivityDetail = () => {
return (
<Layout>
<div className="sidebarContainer">
<Sidebar />
<div className="content">
{/* <ActivityListingRBAC /> */}
<ActivityDetails isUpdate={true} />
{/* <UpdateActivity /> */}
</div>
</div>
</Layout>
);
};
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: {}
};
});
...@@ -6,35 +6,33 @@ import ActivityListing from "../../../components/vendor/ActivityListing"; ...@@ -6,35 +6,33 @@ import ActivityListing from "../../../components/vendor/ActivityListing";
import ActivityListingRBAC from "../../../components/vendor/ActivityListingRBAC"; import ActivityListingRBAC from "../../../components/vendor/ActivityListingRBAC";
import { getAllCategories, getAllSubCategories } from "../../../redux/actions/categoriesAction"; import { getAllCategories, getAllSubCategories } from "../../../redux/actions/categoriesAction";
import { getActivitiesByVendor } from "../../../redux/actions/activityAction"; import { getActivitiesByVendor } from "../../../redux/actions/activityAction";
import { loadUser } from "../../../redux/actions/userActions";
// import { loadUser } from "../redux/actions/userActions"; // import { loadUser } from "../redux/actions/userActions";
// import { wrapper } from "../redux/store"; // import { wrapper } from "../redux/store";
export default function ActivityListingPage() { export default function ActivityListingPage() {
return (
return ( <Layout>
<Layout> <div className="sidebarContainer">
<div className="sidebarContainer"> <Sidebar />
<Sidebar /> <div className="content">
<div className="content"> <ActivityListingRBAC />
<ActivityListingRBAC /> </div>
</div> </div>
</div> </Layout>
</Layout> );
); }
};
/** For server side rendering */ /** For server side rendering */
export const getServerSideProps = wrapper.getServerSideProps(store => async ({ req, query }) => { export const getServerSideProps = wrapper.getServerSideProps(store => async ({ req, query }) => {
// Get the menu data. await store.dispatch(loadUser());
await store.dispatch(getActivitiesByVendor()) await store.dispatch(getActivitiesByVendor());
await store.dispatch(getAllCategories()) await store.dispatch(getAllCategories());
await store.dispatch(getAllSubCategories()) await store.dispatch(getAllSubCategories());
// get the locations data. // get the locations data.
// await store.dispatch(getVendorDetails()) // await store.dispatch(getVendorDetails())
return {
props: {},
}; return {
props: {}
};
}); });
...@@ -10,7 +10,7 @@ export default function ActivityDetailsPage () { ...@@ -10,7 +10,7 @@ export default function ActivityDetailsPage () {
return ( return (
<Layout> <Layout>
<ActivityDetails /> <ActivityDetails isUpdate={false} />
</Layout> </Layout>
); );
}; };
......
...@@ -6,7 +6,13 @@ import { ...@@ -6,7 +6,13 @@ import {
CREATE_ACTIVITY_SUCCESS, CREATE_ACTIVITY_SUCCESS,
GET_ACTIVITIES_FAIL, GET_ACTIVITIES_FAIL,
GET_ACTIVITIES_REQUEST, GET_ACTIVITIES_REQUEST,
GET_ACTIVITIES_SUCCESS GET_ACTIVITIES_SUCCESS,
GET_ACTIVITY_BY_ID_FAIL,
GET_ACTIVITY_BY_ID_REQUEST,
GET_ACTIVITY_BY_ID_SUCCESS,
UPDATE_ACTIVITY_BY_ID_FAIL,
UPDATE_ACTIVITY_BY_ID_REQUEST,
UPDATE_ACTIVITY_BY_ID_SUCCESS
} from "../constants/activitiesConstants"; } from "../constants/activitiesConstants";
import qs from "qs"; import qs from "qs";
import { getLoggedInVendor } from "./vendorActions"; import { getLoggedInVendor } from "./vendorActions";
...@@ -53,8 +59,8 @@ export const createActivity = data => async dispatch => { ...@@ -53,8 +59,8 @@ export const createActivity = data => async dispatch => {
export const getActivitiesByVendor = () => async dispatch => { export const getActivitiesByVendor = () => async dispatch => {
// console.log("data", data); // console.log("data", data);
// const session = await getSession(); const session = await getSession();
// console.log("session", session); console.log("session", session);
try { try {
// const vendorConfig = { // const vendorConfig = {
// headers: { // headers: {
...@@ -96,7 +102,7 @@ export const getActivitiesByVendor = () => async dispatch => { ...@@ -96,7 +102,7 @@ export const getActivitiesByVendor = () => async dispatch => {
const query = { const query = {
filters: {}, filters: {},
populate: ["masterMonths", "subCategory", "subCategory.category", "timeSlots", "masterPincode", "vendor"] populate: ["subCategory", "subCategory.category", "masterPincode", "vendor"]
}; };
const queryString = qs.stringify(query, { const queryString = qs.stringify(query, {
...@@ -109,7 +115,7 @@ export const getActivitiesByVendor = () => async dispatch => { ...@@ -109,7 +115,7 @@ export const getActivitiesByVendor = () => async dispatch => {
// }; // };
const response = await axios.get(`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/experiences?${queryString}`, config); const response = await axios.get(`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/experiences?${queryString}`, config);
// console.log("Response", response.data);
dispatch({ dispatch({
type: GET_ACTIVITIES_SUCCESS, type: GET_ACTIVITIES_SUCCESS,
payload: response.data payload: response.data
...@@ -123,6 +129,38 @@ export const getActivitiesByVendor = () => async dispatch => { ...@@ -123,6 +129,38 @@ export const getActivitiesByVendor = () => async dispatch => {
} }
}; };
export const getActivityById = id => async dispatch => {
try {
dispatch({
type: GET_ACTIVITY_BY_ID_REQUEST,
loading: true
});
const config = {
headers: {
"Content-Type": "application/json"
}
};
const query = {
populate: ["masterMonths", "subCategory", "subCategory.category", "timeSlots", "masterPincode", "vendor"]
};
const queryString = qs.stringify(query, {
encodeValuesOnly: true
});
const response = await axios.get(`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/experiences/${id}/?${queryString}`, config);
dispatch({
type: GET_ACTIVITY_BY_ID_SUCCESS,
payload: response.data
});
} catch (error) {
dispatch({
type: GET_ACTIVITY_BY_ID_FAIL,
payload: error.response.data
});
}
};
// export const getMasterDays = async () => { // export const getMasterDays = async () => {
// const config = { // const config = {
// headers: { // headers: {
...@@ -133,3 +171,40 @@ export const getActivitiesByVendor = () => async dispatch => { ...@@ -133,3 +171,40 @@ export const getActivitiesByVendor = () => async dispatch => {
// console.log("response",response.data); // console.log("response",response.data);
// return response.data; // return response.data;
// }; // };
export const updateActivityById =
({ activityId, updatedData }) =>
async dispatch => {
try {
const session = await getSession();
if (activityId && updatedData) {
console.log("activity session", session);
dispatch({
type: UPDATE_ACTIVITY_BY_ID_REQUEST,
loading: true
});
const config = {
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${session.jwt}`
}
};
// const query = {}
const updateResponse = await axios.put(`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/experiences/${activityId}`, {data: updatedData}, config);
dispatch({
type: UPDATE_ACTIVITY_BY_ID_SUCCESS,
payload: updateResponse.data
});
return updateResponse.data;
}
} catch (error) {
dispatch({
type: UPDATE_ACTIVITY_BY_ID_FAIL,
payload: error.response.data
});
}
};
...@@ -10,9 +10,9 @@ import { ...@@ -10,9 +10,9 @@ import {
} from "../constants/categoryConstants"; } from "../constants/categoryConstants";
export const getAllCategories = () => async dispatch => { export const getAllCategories = () => async dispatch => {
console.log("here >"); // console.log("here >");
try { try {
console.log("here >>"); // console.log("here >>");
dispatch({ dispatch({
type: GET_CATEGORIES_REQUEST type: GET_CATEGORIES_REQUEST
...@@ -32,7 +32,7 @@ export const getAllCategories = () => async dispatch => { ...@@ -32,7 +32,7 @@ export const getAllCategories = () => async dispatch => {
}); });
const response = await axios.get(`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/categories?${queryString}`, config); const response = await axios.get(`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/categories?${queryString}`, config);
console.log("response > ", response); // console.log("response > ", response);
dispatch({ dispatch({
type: GET_CATEGORIES_SUCCESS, type: GET_CATEGORIES_SUCCESS,
payload: response.data payload: response.data
......
...@@ -6,4 +6,12 @@ export const GET_ACTIVITIES_REQUEST = "GET_ACTIVITIES_REQUEST" ...@@ -6,4 +6,12 @@ export const GET_ACTIVITIES_REQUEST = "GET_ACTIVITIES_REQUEST"
export const GET_ACTIVITIES_SUCCESS = "GET_ACTIVITIES_SUCCESS" export const GET_ACTIVITIES_SUCCESS = "GET_ACTIVITIES_SUCCESS"
export const GET_ACTIVITIES_FAIL = "GET_ACTIVITIES_FAIL" export const GET_ACTIVITIES_FAIL = "GET_ACTIVITIES_FAIL"
export const GET_ACTIVITY_BY_ID_REQUEST = "GET_ACTIVITY_BY_ID_REQUEST"
export const GET_ACTIVITY_BY_ID_SUCCESS = "GET_ACTIVITY_BY_ID_SUCCESS"
export const GET_ACTIVITY_BY_ID_FAIL = "GET_ACTIVITY_BY_ID_FAIL"
export const UPDATE_ACTIVITY_BY_ID_REQUEST = "UPDATE_ACTIVITY_BY_ID_REQUEST"
export const UPDATE_ACTIVITY_BY_ID_SUCCESS = "UPDATE_ACTIVITY_BY_ID_SUCCESS"
export const UPDATE_ACTIVITY_BY_ID_FAIL = "UPDATE_ACTIVITY_BY_ID_FAIL"
export const CLEAR_ERRORS = "CLEAR_ERRORS"; export const CLEAR_ERRORS = "CLEAR_ERRORS";
\ No newline at end of file \ No newline at end of file
import { CREATE_ACTIVITY_FAIL, CREATE_ACTIVITY_REQUEST, CREATE_ACTIVITY_SUCCESS, GET_ACTIVITIES_FAIL, GET_ACTIVITIES_REQUEST, GET_ACTIVITIES_SUCCESS } from "../constants/activitiesConstants"; import {
CREATE_ACTIVITY_FAIL,
CREATE_ACTIVITY_REQUEST,
CREATE_ACTIVITY_SUCCESS,
GET_ACTIVITIES_FAIL,
GET_ACTIVITIES_REQUEST,
GET_ACTIVITIES_SUCCESS,
GET_ACTIVITY_BY_ID_FAIL,
GET_ACTIVITY_BY_ID_REQUEST,
GET_ACTIVITY_BY_ID_SUCCESS,
UPDATE_ACTIVITY_BY_ID_FAIL,
UPDATE_ACTIVITY_BY_ID_REQUEST,
UPDATE_ACTIVITY_BY_ID_SUCCESS
} from "../constants/activitiesConstants";
import { CLEAR_ERRORS } from "../constants/vendorConstants"; import { CLEAR_ERRORS } from "../constants/vendorConstants";
export const createActivityReducer = (state = {}, action) => { export const createActivityReducer = (state = {}, action) => {
switch (action.type) { switch (action.type) {
case CREATE_ACTIVITY_REQUEST: case CREATE_ACTIVITY_REQUEST:
return { loading: true }; return { loading: true };
case CREATE_ACTIVITY_SUCCESS:
return {
loading: false,
activityData: action.payload
};
case CREATE_ACTIVITY_FAIL:
return {
loading: false,
error: action.payload.error.message
};
case CLEAR_ERRORS:
return {
...state,
error: null
};
default:
return state;
}
};
case CREATE_ACTIVITY_SUCCESS:
return {
loading: false,
activityData: action.payload
};
case CREATE_ACTIVITY_FAIL:
return {
loading: false,
error: action.payload.error.message
};
case CLEAR_ERRORS:
return {
...state,
error: null
};
default:
return state;
}
};
export const getActivitiesReducer = (state = {}, action) => { export const getActivitiesReducer = (state = {}, action) => {
switch (action.type) { switch (action.type) {
...@@ -56,4 +68,58 @@ export const getActivitiesReducer = (state = {}, action) => { ...@@ -56,4 +68,58 @@ export const getActivitiesReducer = (state = {}, action) => {
default: default:
return state; return state;
} }
};
\ No newline at end of file \ No newline at end of file
};
export const getActivityByIdReducer = (state = {}, action) => {
switch (action.type) {
case GET_ACTIVITY_BY_ID_REQUEST:
return {
loading: true
};
case GET_ACTIVITY_BY_ID_SUCCESS:
return {
loading: false,
activityById: action.payload
};
case GET_ACTIVITY_BY_ID_FAIL:
return {
loading: false,
error: action.payload.error.message
};
case CLEAR_ERRORS:
return {
...state,
error: null
};
default:
return state;
}
};
export const updateActivityByIdReducer = (state = {}, action) => {
switch (action.type) {
case UPDATE_ACTIVITY_BY_ID_REQUEST:
return {
loading: true
};
case UPDATE_ACTIVITY_BY_ID_SUCCESS:
return {
loading: true,
updatedActivity: action.payload
};
case UPDATE_ACTIVITY_BY_ID_FAIL:
return {
loading: true,
error: action.payload.error.message
};
case CLEAR_ERRORS:
return {
...state,
error: null
};
default:
return state;
}
};
...@@ -5,7 +5,7 @@ import { authReducer, forgotPasswordReducer, loadedUserReducer, resetPasswordRed ...@@ -5,7 +5,7 @@ import { authReducer, forgotPasswordReducer, loadedUserReducer, resetPasswordRed
import { enquiryReducer } from "./enquiryReducer"; import { enquiryReducer } from "./enquiryReducer";
import { displayEnquireNowReducer } from "./enquireNowModalReducer"; import { displayEnquireNowReducer } from "./enquireNowModalReducer";
import { getVendorDetailsReducer, loggedInVendorReducer, updateVendorReducer } from "./vendorReducers"; import { getVendorDetailsReducer, loggedInVendorReducer, updateVendorReducer } from "./vendorReducers";
import { createActivityReducer, getActivitiesReducer } from "./activitiesReducer"; import { createActivityReducer, getActivitiesReducer, getActivityByIdReducer, updateActivityByIdReducer } from "./activitiesReducer";
import { getAllCategoriesReducer, getAllSubCategoriesReducer } from "./categoryReducer"; import { getAllCategoriesReducer, getAllSubCategoriesReducer } from "./categoryReducer";
import { getAllTestimonialReducer } from "./testimonialReducer"; import { getAllTestimonialReducer } from "./testimonialReducer";
...@@ -30,6 +30,8 @@ const reducers = combineReducers({ ...@@ -30,6 +30,8 @@ const reducers = combineReducers({
subCategories: getAllSubCategoriesReducer, subCategories: getAllSubCategoriesReducer,
testimonial: getAllTestimonialReducer, testimonial: getAllTestimonialReducer,
allActivitiesData: getActivitiesReducer, allActivitiesData: getActivitiesReducer,
activityById: getActivityByIdReducer,
updatedActivity: updateActivityByIdReducer,
}); });
export default reducers; export default reducers;
...@@ -32,11 +32,11 @@ export const renderImage = imagePath => { ...@@ -32,11 +32,11 @@ export const renderImage = imagePath => {
}; };
export const sanitizeTimeFormat = ({ data }) => { export const sanitizeTimeFormat = ({ data }) => {
console.log("here sant 1") console.log("here sant 1");
if (!data.fromHours || !data.fromMins || !data.toHours || !data.toMins) { if (!data.fromHours || !data.fromMins || !data.toHours || !data.toMins) {
console.log("here sant") console.log("here sant");
return null return null;
} }
const fromTime = `${data.fromHours}:${data.fromMins}:00`; const fromTime = `${data.fromHours}:${data.fromMins}:00`;
const toTime = `${data.toHours}:${data.toMins}:00`; const toTime = `${data.toHours}:${data.toMins}:00`;
...@@ -45,3 +45,19 @@ export const sanitizeTimeFormat = ({ data }) => { ...@@ -45,3 +45,19 @@ export const sanitizeTimeFormat = ({ data }) => {
return { fromTime, toTime, day }; return { fromTime, toTime, day };
// const day // const day
}; };
export const sanitizeTimeRange = ({ data }) => {
// console.log("data >", data[0].$d);
const date = new Date(data.$d);
const day = date.getDate();
const month = date.getMonth() + 1; // Month starts from 0, so add 1
const year = date.getFullYear();
const formattedDay = day < 10 ? "0" + day : day;
const formattedMonth = month < 10 ? "0" + month : month;
const formattedDate = `${year}-${formattedMonth}-${formattedDay}`;
// console.log("date", formattedDate);
return formattedDate;
// const endDate = new Date(data[1].$d);
};
...@@ -2734,6 +2734,14 @@ footer hr { ...@@ -2734,6 +2734,14 @@ footer hr {
width: 33px !important; width: 33px !important;
height: 33px !important; height: 33px !important;
} }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
@media (min-width: 992px) { @media (min-width: 992px) {
.navbar-expand-lg .navbar-nav .nav-link { .navbar-expand-lg .navbar-nav .nav-link {
margin: 0 2rem; margin: 0 2rem;
......
This diff could not be displayed because it is too large.
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!