Commit 29616905 by Jyotsna

conflict resolved

2 parents 6353aded f58d44fd
...@@ -319,7 +319,7 @@ const BlogsItem = () => { ...@@ -319,7 +319,7 @@ const BlogsItem = () => {
<div className="title">{data.title}</div> <div className="title">{data.title}</div>
<div className="discription">{data.discription}</div> <div className="discription">{data.discription}</div>
<div className="read-more"> <div className="read-more">
<Button href="/listing" variant="primary"> <Button href="/blog-details" variant="primary">
Read More Read More
</Button> </Button>
</div> </div>
......
...@@ -37,7 +37,10 @@ const Footer = () => { ...@@ -37,7 +37,10 @@ const Footer = () => {
<h3>QUICK LINKS</h3> <h3>QUICK LINKS</h3>
<ul> <ul>
<li> <li>
<a href="">About Us</a> <a href="/about-us">About Us</a>
</li>
<li>
<a href="/contact-us">Contact Us</a>
</li> </li>
<li> <li>
<a href="">Corporate Programs</a> <a href="">Corporate Programs</a>
......
...@@ -41,8 +41,8 @@ const Header = () => { ...@@ -41,8 +41,8 @@ const Header = () => {
<Navbar.Toggle aria-controls="navbarScroll" /> <Navbar.Toggle aria-controls="navbarScroll" />
<Navbar.Collapse id="navbarScroll"> <Navbar.Collapse id="navbarScroll">
<Nav className=" my-2 my-lg-0" style={{ maxHeight: "100px" }} navbarScroll> <Nav className=" my-2 my-lg-0" style={{ maxHeight: "100px" }} navbarScroll>
<Nav.Link href="#action1">Blogs</Nav.Link> <Nav.Link href="/blog">Blogs</Nav.Link>
<Nav.Link href="#action2" className="gift-card"> <Nav.Link href="/gift-card" className="gift-card">
Gift Card Gift Card
<span className="image-container"> <span className="image-container">
<Image layout="fill" className="image img-fluid" src="/images/icons/gift-card-icon.svg" alt="" /> <Image layout="fill" className="image img-fluid" src="/images/icons/gift-card-icon.svg" alt="" />
......
This diff could not be displayed because it is too large.
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
}, },
"dependencies": { "dependencies": {
"@stripe/stripe-js": "^1.35.0", "@stripe/stripe-js": "^1.35.0",
"antd": "^5.15.3",
"axios": "^0.27.2", "axios": "^0.27.2",
"easyinvoice": "^2.3.3", "easyinvoice": "^2.3.3",
"formik": "^2.2.9", "formik": "^2.2.9",
......
import React from "react"; import React from "react";
import Layout from "../../../components/layout/Layout"; import Layout from "../../../components/layout/Layout";
import ActivityDetails from "../../../components/vendor/ActivityDetails"; 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 () { export default function ActivityDetailsPage () {
...@@ -9,4 +13,19 @@ export default function ActivityDetailsPage () { ...@@ -9,4 +13,19 @@ export default function ActivityDetailsPage () {
<ActivityDetails /> <ActivityDetails />
</Layout> </Layout>
); );
};
\ No newline at end of file \ 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 \ No newline at end of file
...@@ -3,6 +3,7 @@ import { getSession } from "next-auth/react"; ...@@ -3,6 +3,7 @@ import { getSession } from "next-auth/react";
import { CREATE_ACTIVITY_FAIL, CREATE_ACTIVITY_REQUEST, CREATE_ACTIVITY_SUCCESS } from "../constants/activitiesConstants"; import { CREATE_ACTIVITY_FAIL, CREATE_ACTIVITY_REQUEST, CREATE_ACTIVITY_SUCCESS } from "../constants/activitiesConstants";
export const createActivity = data => async dispatch => { export const createActivity = data => async dispatch => {
console.log("data", data);
const session = await getSession(); const session = await getSession();
try { try {
if (!session) { if (!session) {
...@@ -26,7 +27,7 @@ export const createActivity = data => async dispatch => { ...@@ -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({ dispatch({
type: CREATE_ACTIVITY_SUCCESS, type: CREATE_ACTIVITY_SUCCESS,
...@@ -40,3 +41,14 @@ export const createActivity = data => async dispatch => { ...@@ -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 => { ...@@ -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); const response = await axios.get(`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/vendors/?${queryString}`, config);
console.log("response", response.data.data[0]); console.log("response", response.data.data[0]);
dispatch({ dispatch({
type: GET_LOGGED_IN_VENDOR_SUCCESS type: GET_LOGGED_IN_VENDOR_SUCCESS,
payload: response.data.data[0]
}); });
return response.data.data[0]; return response.data.data[0];
} catch (error) { } 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 \ 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 \ No newline at end of file
...@@ -6,6 +6,7 @@ import { enquiryReducer } from "./enquiryReducer"; ...@@ -6,6 +6,7 @@ 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 } from "./activitiesReducer"; import { createActivityReducer } from "./activitiesReducer";
import { getAllCategoriesReducer, getAllSubCategoriesReducer } from "./categoryReducer";
const reducers = combineReducers({ const reducers = combineReducers({
townships: townshipsReducer, townships: townshipsReducer,
...@@ -24,6 +25,8 @@ const reducers = combineReducers({ ...@@ -24,6 +25,8 @@ const reducers = combineReducers({
updatedVendorData: updateVendorReducer, updatedVendorData: updateVendorReducer,
vendorDetails: getVendorDetailsReducer, vendorDetails: getVendorDetailsReducer,
activityData: createActivityReducer, activityData: createActivityReducer,
categories: getAllCategoriesReducer,
subCategories: getAllSubCategoriesReducer,
}); });
export default reducers; export default reducers;
...@@ -6,7 +6,7 @@ export const cleanImage = originalImage => { ...@@ -6,7 +6,7 @@ export const cleanImage = originalImage => {
if (originalImage.url.startsWith("http")) { if (originalImage.url.startsWith("http")) {
imageUrl = originalImage.url; imageUrl = originalImage.url;
} else { } 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}`; imageUrl = `${process.env.NEXT_PUBLIC_BACKEND_API_URL}${originalImage.url}`;
} }
} }
...@@ -14,7 +14,6 @@ export const cleanImage = originalImage => { ...@@ -14,7 +14,6 @@ export const cleanImage = originalImage => {
return imageUrl; return imageUrl;
}; };
export const renderImage = imagePath => { export const renderImage = imagePath => {
let imageUrl = "/images/default.svg"; let imageUrl = "/images/default.svg";
...@@ -32,3 +31,17 @@ export const renderImage = imagePath => { ...@@ -32,3 +31,17 @@ export const renderImage = imagePath => {
return imageUrl; 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
};
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!