Commit f58d44fd by Ravindra Kanojiya
2 parents e4bc11cc 5ff3e0ee
......@@ -8,8 +8,7 @@ import SignUpToExperienceOurPlatform from '../home/SignUpToExperienceOurPlatform
import PageBanner from './PageBanner.js'
const AboutUs = () => {
return (
<>
<>
<PageBanner />
<MissionVision />
<Offers />
......
import { signOut } from "next-auth/react";
import Image from "next/image";
import Link from "next/link";
import { useRouter } from "next/router";
import React, { Fragment, useEffect, useState } from "react";
import { renderImage } from "../../services/imageHandling";
const DropdownUserProfile = () => {
const router = useRouter();
const logoutHandler = () => {
signOut();
};
return (
<Fragment>
<div className="row">
<div className="col-12 col-lg-12">
<div>
<ul className="link-list">
<li>
<Link href="/personal-details">
<a>
Personal Info <i className="arrow-right"></i>
</a>
</Link>
</li>
</ul>
</div>
</div>
</div>
</Fragment>
);
};
export default DropdownUserProfile;
......@@ -24,7 +24,7 @@ const Login = props => {
<div className="row">
<div className="col-11 col-lg-4 login-div">
<div className="">
<h2>{props.type == "vendor" ? "Vendor Login" : "Login to Experience"}</h2>
<h2>{props.type == "user" ? "Login to Experience" : (props.type == "vendor" ? "Vendor Login" : "Admin Login")}</h2>
<div className="form-container">
<Formik
initialValues={{
......
This diff could not be displayed because it is too large.
......@@ -10,6 +10,7 @@
},
"dependencies": {
"@stripe/stripe-js": "^1.35.0",
"antd": "^5.15.3",
"axios": "^0.27.2",
"easyinvoice": "^2.3.3",
"formik": "^2.2.9",
......@@ -41,7 +42,7 @@
"redux": "^4.2.0",
"redux-devtools-extension": "^2.13.9",
"redux-thunk": "^2.4.1",
"swiper": "^11.0.7",
"swiper": "^11.1.0",
"validator": "^13.7.0",
"yup": "^0.32.11"
},
......
import React from "react";
import Layout from "../../../components/layout/Layout";
import ActivityDetails from "../../../components/vendor/ActivityDetails";
import { getAllCategories, getAllSubCategories } from "../../../redux/actions/categoriesAction";
import { loadUser } from "../../../redux/actions/userActions";
import { getLoggedInVendor } from "../../../redux/actions/vendorActions";
import { wrapper } from "../../../redux/store";
export default function ActivityDetailsPage () {
......@@ -9,4 +13,19 @@ export default function ActivityDetailsPage () {
<ActivityDetails />
</Layout>
);
};
\ No newline at end of file
};
/** For server side rendering */
export const getServerSideProps = wrapper.getServerSideProps(store => async ({ req, query }) => {
await store.dispatch(loadUser());
await store.dispatch(getAllCategories())
// await store.dispatch(getLoggedInVendor())
// await store.dispatch(getAllSubCategories())
return {
props: {}
};
});
\ No newline at end of file
......@@ -3,6 +3,7 @@ import { getSession } from "next-auth/react";
import { CREATE_ACTIVITY_FAIL, CREATE_ACTIVITY_REQUEST, CREATE_ACTIVITY_SUCCESS } from "../constants/activitiesConstants";
export const createActivity = data => async dispatch => {
console.log("data", data);
const session = await getSession();
try {
if (!session) {
......@@ -26,7 +27,7 @@ export const createActivity = data => async dispatch => {
}
};
const response = await axios.post(`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/experiences`);
const response = await axios.post(`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/experiences`, activityData, config);
dispatch({
type: CREATE_ACTIVITY_SUCCESS,
......@@ -40,3 +41,14 @@ export const createActivity = data => async dispatch => {
});
}
};
// export const getMasterDays = async () => {
// const config = {
// headers: {
// "Content-Type": "application/json"
// }
// };
// const response = await axios.get(`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/master-days`, config);
// console.log("response",response.data);
// return response.data;
// };
import axios from "axios";
import qs from "qs";
import {
GET_CATEGORIES_FAIL,
GET_CATEGORIES_REQUEST,
GET_CATEGORIES_SUCCESS,
GET_SUB_CATEGORIES_FAIL,
GET_SUB_CATEGORIES_REQUEST,
GET_SUB_CATEGORIES_SUCCESS
} from "../constants/categoryConstants";
export const getAllCategories = () => async dispatch => {
try {
dispatch({
type: GET_CATEGORIES_REQUEST
});
const config = {
headers: {
"Content-Type": "application/json"
}
};
const response = await axios.get(`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/categories`, config);
dispatch({
type: GET_CATEGORIES_SUCCESS,
payload: response.data
});
return response.data;
} catch (error) {
dispatch({
type: GET_CATEGORIES_FAIL,
payload: error.response.data
});
}
};
export const getAllSubCategories = categoryName => async dispatch => {
try {
dispatch({
type: GET_SUB_CATEGORIES_REQUEST
});
const config = {
headers: {
"Content-Type": "application/json"
}
};
const query = {
filters: {
category: {
name: { $eq: categoryName }
}
},
populate: ["category"]
};
const queryString = qs.stringify(query, {
encodeValuesOnly: true
});
const response = await axios.get(`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/sub-categories/?${queryString}`, config);
dispatch({
type: GET_SUB_CATEGORIES_SUCCESS,
payload: response.data
});
return response.data;
} catch (error) {
dispatch({
type: GET_SUB_CATEGORIES_FAIL,
payload: error.response.data
});
}
};
......@@ -119,7 +119,8 @@ export const getLoggedInVendor = () => async dispatch => {
const response = await axios.get(`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/vendors/?${queryString}`, config);
console.log("response", response.data.data[0]);
dispatch({
type: GET_LOGGED_IN_VENDOR_SUCCESS
type: GET_LOGGED_IN_VENDOR_SUCCESS,
payload: response.data.data[0]
});
return response.data.data[0];
} catch (error) {
......
export const GET_CATEGORIES_REQUEST = "GET_CATEGORIES_REQUEST"
export const GET_CATEGORIES_SUCCESS = "GET_CATEGORIES_SUCCESS"
export const GET_CATEGORIES_FAIL = "GET_CATEGORIES_FAIL"
export const GET_SUB_CATEGORIES_REQUEST = "GET_SUB_CATEGORIES_REQUEST"
export const GET_SUB_CATEGORIES_SUCCESS = "GET_SUB_CATEGORIES_SUCCESS"
export const GET_SUB_CATEGORIES_FAIL = "GET_SUB_CATEGORIES_FAIL"
export const CLEAR_ERRORS = "CLEAR_ERRORS";
\ No newline at end of file
import { GET_CATEGORIES_REQUEST, CLEAR_ERRORS, GET_CATEGORIES_SUCCESS, GET_CATEGORIES_FAIL, GET_SUB_CATEGORIES_REQUEST, GET_SUB_CATEGORIES_FAIL, GET_SUB_CATEGORIES_SUCCESS } from "../constants/categoryConstants";
export const getAllCategoriesReducer = (state = { loading: true, success: false, categories: null }, action) => {
switch (action.type) {
case GET_CATEGORIES_REQUEST:
return {
loading: true,
};
case GET_CATEGORIES_SUCCESS:
return {
loading: false,
categories: action.payload
};
case GET_CATEGORIES_FAIL:
return {
loading: false,
error: action.payload.error.message
};
case CLEAR_ERRORS:
return {
...state,
error: null
};
default:
return state;
}
};
export const getAllSubCategoriesReducer = (state = { loading: true, success: false, subCategories: null }, action) => {
switch (action.type) {
case GET_SUB_CATEGORIES_REQUEST:
return {
loading: true,
};
case GET_SUB_CATEGORIES_SUCCESS:
return {
loading: false,
subCategories: action.payload
};
case GET_SUB_CATEGORIES_FAIL:
return {
loading: false,
error: action.payload.error.message
};
case CLEAR_ERRORS:
return {
...state,
error: null
};
default:
return state;
}
};
\ No newline at end of file
......@@ -6,6 +6,7 @@ import { enquiryReducer } from "./enquiryReducer";
import { displayEnquireNowReducer } from "./enquireNowModalReducer";
import { getVendorDetailsReducer, loggedInVendorReducer, updateVendorReducer } from "./vendorReducers";
import { createActivityReducer } from "./activitiesReducer";
import { getAllCategoriesReducer, getAllSubCategoriesReducer } from "./categoryReducer";
const reducers = combineReducers({
townships: townshipsReducer,
......@@ -24,6 +25,8 @@ const reducers = combineReducers({
updatedVendorData: updateVendorReducer,
vendorDetails: getVendorDetailsReducer,
activityData: createActivityReducer,
categories: getAllCategoriesReducer,
subCategories: getAllSubCategoriesReducer,
});
export default reducers;
......@@ -6,7 +6,7 @@ export const cleanImage = originalImage => {
if (originalImage.url.startsWith("http")) {
imageUrl = originalImage.url;
} else {
/** If now S3, then images are stored under the public/uploads directory of Strapi */
/** If now S3, then images are stored under the public/uploads directory of Strapi */
imageUrl = `${process.env.NEXT_PUBLIC_BACKEND_API_URL}${originalImage.url}`;
}
}
......@@ -14,7 +14,6 @@ export const cleanImage = originalImage => {
return imageUrl;
};
export const renderImage = imagePath => {
let imageUrl = "/images/default.svg";
......@@ -32,3 +31,17 @@ export const renderImage = imagePath => {
return imageUrl;
};
export const sanitizeTimeFormat = ({ data }) => {
console.log("here sant 1")
if (!data.fromHours || !data.fromMins || !data.toHours || !data.toMins) {
console.log("here sant")
return null
}
const fromTime = `${data.fromHours}:${data.fromMins}:00`;
const toTime = `${data.toHours}:${data.toMins}:00`;
const day = data.day;
return { fromTime, toTime, day };
// const day
};
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!