Skip to content

Commit 7e9659a

Browse files
authored
Merge pull request #72 from JahanviSharma16/main
Complete Cancellation policy
2 parents a001a8b + 395e166 commit 7e9659a

File tree

10 files changed

+12726
-65
lines changed

10 files changed

+12726
-65
lines changed

components/ErrorBoundaries.tsx

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import React, { Component, ErrorInfo, ReactNode } from 'react';
2+
3+
interface ErrorBoundaryProps {
4+
children: ReactNode;
5+
}
6+
7+
interface ErrorBoundaryState {
8+
hasError: boolean;
9+
error: Error | null;
10+
errorInfo: ErrorInfo | null;
11+
}
12+
13+
class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
14+
constructor(props: ErrorBoundaryProps) {
15+
super(props);
16+
this.state = {
17+
hasError: false,
18+
error: null,
19+
errorInfo: null
20+
};
21+
}
22+
23+
componentDidCatch(error: Error, errorInfo: ErrorInfo) {
24+
this.setState({
25+
hasError: true,
26+
error: error,
27+
errorInfo: errorInfo
28+
});
29+
30+
31+
}
32+
33+
render() {
34+
if (this.state.hasError) {
35+
return (
36+
<div>
37+
<h2>Something went wrong.</h2>
38+
<p>{this.state.error && this.state.error.toString()}</p>
39+
<p>Component stack trace:</p>
40+
<pre>{this.state.errorInfo?.componentStack}</pre>
41+
</div>
42+
);
43+
}
44+
45+
return this.props.children;
46+
}
47+
}
48+
49+
export default ErrorBoundary;

components/Footer.tsx

+47-59
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
import React, { useContext, useState } from "react";
2-
import Link from "next/link";
32
import Image from "next/image";
43
import { useRouter } from "next/router";
5-
64
import { location, logo, phone } from "../assets";
75
import AnimatedBorder from "./AnimatedBorder";
8-
import {
9-
footerButtons,
10-
socialMediaHandles,
11-
socialMediaTealIcons,
12-
} from "../helper/constant";
6+
import { footerButtons, socialMediaHandles, socialMediaTealIcons } from "../helper/constant";
137
import AppContext from "./AppContext";
8+
import Link from "next/link";
149

1510
const Footer = () => {
1611
const [onHover, setOnHover] = useState(false);
@@ -23,14 +18,17 @@ const Footer = () => {
2318
router.push(href);
2419
};
2520

26-
const handleNavigteTo = (item: any) => {
21+
const handleNavigateTo = (item: any) => {
2722
if (item.title === "Pricing") {
28-
if (router.pathname !== "/" && router.pathname !== "pricing")
29-
router.push("/#pricing");
23+
if (router.pathname !== "/" && router.pathname !== "/pricing") {
24+
throw new Error("Invalid pathname");
25+
}
26+
router.push("/#pricing");
3027
return;
3128
}
32-
if (item.target) window.open(item?.route, "_blank");
33-
else {
29+
if (item.target) {
30+
window.open(item?.route, "_blank");
31+
} else {
3432
handleNavigate(item.route);
3533
}
3634
};
@@ -41,7 +39,7 @@ const Footer = () => {
4139
id="footer"
4240
className="flex gap-4 md:gap-10 lg:gap-20 xl:gap-24 flex-col lg:flex-row justify-center pl-4 xsm:px-6 sm:pl-8 lg:pl-20 py-10 bg-main-secondary"
4341
>
44-
<div className="w-full lg:w-1/4 font-miligramText400">
42+
<div className="w-full lg:w-1/4 font-miligramText400">
4543
<Image
4644
src={logo}
4745
alt="logo"
@@ -51,9 +49,7 @@ const Footer = () => {
5149
<div className="flex items-center my-3 gap-2">
5250
{socialMediaHandles.map((item, i) => (
5351
<Image
54-
src={
55-
hoverOnSocialMedia === i ? socialMediaTealIcons[i] : item.src
56-
}
52+
src={hoverOnSocialMedia === i ? socialMediaTealIcons[i] : item.src}
5753
alt={item.src}
5854
key={i}
5955
className="h-7 cursor-pointer brightness-50 hover:brightness-100"
@@ -65,7 +61,7 @@ const Footer = () => {
6561
/>
6662
))}
6763
</div>
68-
<div className="flex justify-start items-start mt-4 text-[0.9rem] sm:text-[1rem] ml-2">
64+
<div className="flex justify-start items-start mt-4 text-[0.9rem] sm:text-[1rem] ml-2">
6965
<Image
7066
src={location}
7167
alt="location"
@@ -84,7 +80,7 @@ const Footer = () => {
8480
}
8581
>
8682
<p className="mt-1 w-fit group-hover:text-white relative inline lg:block">
87-
IT-07, IT Park,
83+
IT-07, IT Park,
8884
<AnimatedBorder />
8985
</p>
9086
<p className="mt-1 w-fit group-hover:text-white relative inline lg:block">
@@ -97,62 +93,54 @@ const Footer = () => {
9793
</p>
9894
</div>
9995
</div>
100-
<div className="flex justify-start mt-3 ml-2">
96+
<div className="flex justify-start mt-3 ml-2">
10197
<Image
10298
src={phone}
10399
alt="phone"
104-
className={`mt-[5px] mr-4 ${
105-
hoverOnMob ? "brightness-200" : "brightness-50 "
106-
}`}
100+
className={`mt-[5px] mr-4 ${hoverOnMob ? "brightness-200" : "brightness-50"}`}
107101
/>
108102
<a
109103
onMouseEnter={() => setHoverOnMob(true)}
110104
onMouseLeave={() => setHoverOnMob(false)}
111105
href="tel:01353504103"
112-
className={`group relative text-main-light_white m-0 ml-1 text-[0.9rem] sm:text-[1rem] mt-[4px] hover:text-white`}
106+
className="group relative text-main-light_white m-0 ml-1 text-[0.9rem] sm:text-[1rem] mt-[4px] hover:text-white"
113107
>
114108
+91 7008493497
115109
<AnimatedBorder />
116110
</a>
117111
</div>
118112
</div>
119113
<div className="flex justify-center flex-wrap w-full lg:w-3/4">
120-
{footerButtons.map((item, i) => {
121-
return (
122-
<div className="w-1/2 sm:w-1/4 mt-6 sm:mt-0" key={i}>
123-
<p className="text-white text-[1.1rem] sm:text-[1.4rem] font-miligrambold">
124-
{item.title}
125-
</p>
126-
{item.buttons.map((item, i) => (
127-
<p
128-
id={item.title}
129-
key={i}
130-
className="relative group text-[0.9rem] md:text-[1.2rem] text-main-light_white mt-3 cursor-pointer font-miligramTextBook font-light hover:text-white w-fit"
131-
onClick={() => {
132-
handleNavigteTo(item);
133-
}}
134-
>
135-
{item.title === "Pricing" ? (
136-
router.pathname === "/" ||
137-
router.pathname === "pricing" ? (
138-
<Link href="#pricing">Pricing</Link>
139-
) : (
140-
"Pricing"
141-
)
114+
{footerButtons.map((item, i) => (
115+
<div className="w-1/2 sm:w-1/4 mt-6 sm:mt-0" key={i}>
116+
<p className="text-white text-[1.1rem] sm:text-[1.4rem] font-miligrambold">{item.title}</p>
117+
{item.buttons.map((item, j) => (
118+
<p
119+
key={j}
120+
className="relative group text-[0.9rem] md:text-[1.2rem] text-main-light_white mt-3 cursor-pointer font-miligramTextBook font-light hover:text-white w-fit"
121+
onClick={() => {
122+
handleNavigateTo(item);
123+
}}
124+
>
125+
{item.title === "Pricing" ? (
126+
router.pathname === "/" || router.pathname === "/pricing" ? (
127+
<Link href="#pricing">Pricing</Link>
142128
) : (
143-
item.title
144-
)}
145-
{item?.chip && jobs?.jobs_listing?.length && (
146-
<span className="absolute w-auto right-[-340%] md:right-[-281%] xl:right-[-240%] xxl:right-[-330%] bottom-[8%] font-miligramMedium text-[0.7rem] xxl:text-[1rem] bg-main-greenOpt-200 border-[0px] border-main-lightTeal text-main-teal px-2 py-[3px] rounded-md pointer-events-none">
147-
{item.chip}!
148-
</span>
149-
)}
150-
<AnimatedBorder />
151-
</p>
152-
))}
153-
</div>
154-
);
155-
})}
129+
"Pricing"
130+
)
131+
) : (
132+
item.title
133+
)}
134+
{item?.chip && jobs?.jobs_listing?.length && (
135+
<span className="absolute w-auto right-[-340%] md:right-[-281%] xl:right-[-240%] xxl:right-[-330%] bottom-[8%] font-miligramMedium text-[0.7rem] xxl:text-[1rem] bg-main-greenOpt-200 border-[0px] border-main-lightTeal text-main-teal px-2 py-[3px] rounded-md pointer-events-none">
136+
{item.chip}!
137+
</span>
138+
)}
139+
<AnimatedBorder />
140+
</p>
141+
))}
142+
</div>
143+
))}
156144
</div>
157145
</div>
158146
<p className="py-5 px-2 text-main-light_white text-[0.85rem] sm:text-[1.2rem] text-center font-miligramText400">
@@ -162,4 +150,4 @@ const Footer = () => {
162150
);
163151
};
164152

165-
export default Footer;
153+
export default Footer;

components/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ export { default as OurFamily } from "./pages-components/about/OurFamily";
3636

3737
// ********** ---| SECTIONS COMPONENTS |--- *********
3838
// WHY KODERS SECTION COMPONENTS
39-
export { default as Info } from "./section-comonents/why-koders/Info";
39+
export { default as Info } from "./section-components/why-koders/Info";
4040
// PRICING SECTION COMPONENTS
41-
export { default as PricingCard } from "./section-comonents/pricing/PricingCard";
41+
export { default as PricingCard } from "./section-components/pricing/PricingCard";

0 commit comments

Comments
 (0)