Skip to content

Commit bc8f33f

Browse files
authored
Merge pull request #3 from twodevs-ops/feat/code-improvements
Code improvements in the application
2 parents 615c228 + b56f0e1 commit bc8f33f

15 files changed

Lines changed: 110 additions & 149 deletions

File tree

app/(public)/about/page.tsx

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import Header from "@/components/header";
2-
import Footer from "@/components/footer";
31
import { Button } from "@/components/ui/button";
42
import Link from "next/link";
53
import Image from "next/image";
@@ -10,23 +8,16 @@ import {
108
techSectionTitle,
119
comparisons,
1210
} from "@/constants";
11+
import { PageHeader } from "@/components/common";
1312

1413
export default function AboutPage() {
1514
return (
1615
<main>
17-
<Header />
18-
1916
{/* Hero */}
20-
<section className="pt-20 pb-16 md:pt-32 md:pb-24 bg-linear-to-b from-primary/5 to-transparent">
21-
<div className="container-custom">
22-
<h1 className="heading-xl text-primary mb-6 text-balance">
23-
{aboutPageContent.hero.title}
24-
</h1>
25-
<p className="text-lg text-foreground/80">
26-
{aboutPageContent.hero.description}
27-
</p>
28-
</div>
29-
</section>
17+
<PageHeader
18+
title={aboutPageContent.hero.title}
19+
description={aboutPageContent.hero.description}
20+
/>
3021

3122
{/* Our Story */}
3223
<section className="py-16 md:py-24">
@@ -216,8 +207,6 @@ export default function AboutPage() {
216207
</Button>
217208
</div>
218209
</section>
219-
220-
<Footer />
221210
</main>
222211
);
223212
}

app/(public)/blog/page.tsx

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22

33
import type React from "react";
44

5-
import Header from "@/components/header";
6-
import Footer from "@/components/footer";
75
import { Button } from "@/components/ui/button";
86
import { Input } from "@/components/ui/input";
97
import Link from "next/link";
108
import { Calendar, ArrowRight, CheckCircle2, AlertCircle } from "lucide-react";
119
import { useState } from "react";
1210
import Image from "next/image";
11+
import { PageHeader } from "@/components/common";
1312

1413
export default function BlogPage() {
1514
const [email, setEmail] = useState("");
@@ -117,19 +116,11 @@ export default function BlogPage() {
117116

118117
return (
119118
<main>
120-
<Header />
121-
122119
{/* Hero */}
123-
<section className="pt-20 pb-16 md:pt-32 md:pb-24 bg-linear-to-b from-primary/5 to-transparent">
124-
<div className="container-custom">
125-
<h1 className="heading-xl text-primary mb-6 text-balance">
126-
Blog & Resources
127-
</h1>
128-
<p className="text-lg text-foreground/80">
129-
Tips, guides, and insights for growing your business online
130-
</p>
131-
</div>
132-
</section>
120+
<PageHeader
121+
title="Blog & Resources"
122+
description="Tips, guides, and insights for growing your business online"
123+
/>
133124

134125
{/* Blog Grid */}
135126
<section className="py-16 md:py-24">
@@ -229,8 +220,6 @@ export default function BlogPage() {
229220
</form>
230221
</div>
231222
</section>
232-
233-
<Footer />
234223
</main>
235224
);
236225
}

app/(public)/contact/page.tsx

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
AlertCircle,
1919
} from "lucide-react";
2020
import { contactPageContent, contactInfo, contactFAQ } from "@/constants";
21+
import { PageHeader } from "@/components/common";
2122

2223
export default function ContactPage() {
2324
const [formData, setFormData] = useState({
@@ -104,19 +105,11 @@ export default function ContactPage() {
104105

105106
return (
106107
<main>
107-
<Header />
108-
109108
{/* Hero */}
110-
<section className="pt-20 pb-16 md:pt-32 md:pb-24 bg-linear-to-b from-primary/5 to-transparent">
111-
<div className="container-custom">
112-
<h1 className="heading-xl text-primary mb-6 text-balance">
113-
{contactPageContent.hero.title}
114-
</h1>
115-
<p className="text-lg text-foreground/80">
116-
{contactPageContent.hero.description}
117-
</p>
118-
</div>
119-
</section>
109+
<PageHeader
110+
title={contactPageContent.hero.title}
111+
description={contactPageContent.hero.description}
112+
/>
120113

121114
{/* Contact Section */}
122115
<section className="py-16 md:py-24">
@@ -155,7 +148,9 @@ export default function ContactPage() {
155148
<h3 className="font-bold text-lg mb-2">
156149
{contactPageContent.contactCards.location.title}
157150
</h3>
158-
<p className="text-foreground/70">{contactInfo.location.full}</p>
151+
<p className="text-foreground/70">
152+
{contactInfo.location.full}
153+
</p>
159154
</div>
160155

161156
<div className="p-6 rounded-lg border hover:shadow-lg transition bg-card">
@@ -292,9 +287,7 @@ export default function ContactPage() {
292287
<div>
293288
<textarea
294289
name="message"
295-
placeholder={
296-
contactPageContent.form.placeholders.message
297-
}
290+
placeholder={contactPageContent.form.placeholders.message}
298291
value={formData.message}
299292
onChange={handleChange}
300293
rows={6}
@@ -327,10 +320,8 @@ export default function ContactPage() {
327320
<iframe
328321
width="100%"
329322
height="100%"
330-
frameBorder="0"
331323
title="Amritsar, Punjab"
332324
src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3405.3656206644344!2d74.87919!3d31.633!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3919038e66666667%3A0x1234567890abc!2sAmritsar%2C%20Punjab!5e0!3m2!1sen!2sin!4v1234567890"
333-
// allowFullScreen=""
334325
loading="lazy"
335326
referrerPolicy="no-referrer-when-downgrade"
336327
></iframe>
@@ -361,8 +352,6 @@ export default function ContactPage() {
361352
</div>
362353
</div>
363354
</section>
364-
365-
<Footer />
366355
</main>
367356
);
368357
}

app/(public)/layout.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Footer from "@/components/footer";
2+
import Header from "@/components/header";
3+
4+
export default function Layout({ children }: { children: React.ReactNode }) {
5+
return (
6+
<>
7+
<Header />
8+
{children}
9+
<Footer />
10+
</>
11+
);
12+
}

app/page.tsx renamed to app/(public)/page.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import Header from "@/components/header";
2-
import Footer from "@/components/footer";
31
import { Button } from "@/components/ui/button";
42
import Link from "next/link";
53
import { Check, Star, ArrowRight } from "lucide-react";
@@ -19,8 +17,6 @@ import {
1917
export default function Home() {
2018
return (
2119
<main>
22-
<Header />
23-
2420
{/* Hero Section */}
2521
<section className="pt-20 pb-24 md:pt-32 md:pb-32 bg-linear-to-b from-primary/5 to-transparent">
2622
<div className="container-custom">
@@ -170,7 +166,9 @@ export default function Home() {
170166
: "bg-primary hover:bg-primary/90"
171167
}`}
172168
>
173-
<Link href="/contact">{pricingSection.labels.getStarted}</Link>
169+
<Link href="/contact">
170+
{pricingSection.labels.getStarted}
171+
</Link>
174172
</Button>
175173
</div>
176174
))}
@@ -289,8 +287,6 @@ export default function Home() {
289287
</Button>
290288
</div>
291289
</section>
292-
293-
<Footer />
294290
</main>
295291
);
296292
}

app/(public)/portfolio/page.tsx

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
"use client";
22

33
import { useState } from "react";
4-
import Header from "@/components/header";
5-
import Footer from "@/components/footer";
64
import { Button } from "@/components/ui/button";
75
import Link from "next/link";
86
import { ExternalLink } from "lucide-react";
97
import Image from "next/image";
8+
import { PageHeader } from "@/components/common";
109

1110
export default function PortfolioPage() {
1211
const [filter, setFilter] = useState("all");
@@ -82,19 +81,11 @@ export default function PortfolioPage() {
8281

8382
return (
8483
<main>
85-
<Header />
86-
8784
{/* Hero */}
88-
<section className="pt-20 pb-16 md:pt-32 md:pb-24 bg-linear-to-b from-primary/5 to-transparent">
89-
<div className="container-custom">
90-
<h1 className="heading-xl text-primary mb-6 text-balance">
91-
Our Recent Work
92-
</h1>
93-
<p className="text-lg text-foreground/80 max-w-2xl">
94-
Websites that bring results for Amritsar businesses
95-
</p>
96-
</div>
97-
</section>
85+
<PageHeader
86+
title="Our Recent Work"
87+
description="Websites that bring results for Amritsar businesses"
88+
/>
9889

9990
{/* Filter */}
10091
<section className="py-8">
@@ -196,8 +187,6 @@ export default function PortfolioPage() {
196187
</Button>
197188
</div>
198189
</section>
199-
200-
<Footer />
201190
</main>
202191
);
203192
}

app/(public)/pricing/page.tsx

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,16 @@
1-
import Header from "@/components/header";
2-
import Footer from "@/components/footer";
31
import { Button } from "@/components/ui/button";
42
import Link from "next/link";
53
import { Check } from "lucide-react";
4+
import { PageHeader } from "@/components/common";
65

76
export default function PricingPage() {
87
return (
98
<main>
10-
<Header />
11-
129
{/* Hero */}
13-
<section className="pt-20 pb-16 md:pt-32 md:pb-24 bg-linear-to-b from-primary/5 to-transparent">
14-
<div className="container-custom">
15-
<h1 className="heading-xl text-primary mb-6 text-balance">
16-
Transparent Pricing
17-
</h1>
18-
<p className="text-lg text-foreground/80 max-w-2xl">
19-
No hidden costs, no surprises. Choose the plan that fits your needs.
20-
All plans include free support.
21-
</p>
22-
</div>
23-
</section>
10+
<PageHeader
11+
title="Transparent Pricing"
12+
description="No hidden costs, no surprises. Choose the plan that fits your needs. All plans include free support."
13+
/>
2414

2515
{/* Pricing Plans */}
2616
<section className="py-16 md:py-24">
@@ -301,8 +291,6 @@ export default function PricingPage() {
301291
</Button>
302292
</div>
303293
</section>
304-
305-
<Footer />
306294
</main>
307295
);
308296
}

app/(public)/services/page.tsx

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,16 @@
1-
import Header from "@/components/header";
2-
import Footer from "@/components/footer";
31
import { Button } from "@/components/ui/button";
42
import Link from "next/link";
53
import { servicesPageContent } from "@/constants";
4+
import { PageHeader } from "@/components/common";
65

76
export default function ServicesPage() {
87
return (
98
<main>
10-
<Header />
11-
129
{/* Hero */}
13-
<section className="pt-20 pb-16 md:pt-32 md:pb-6 bg-linear-to-b from-primary/5 to-transparent">
14-
<div className="container-custom">
15-
<h1 className="heading-xl text-primary mb-6 text-balance">
16-
{servicesPageContent.hero.title}
17-
</h1>
18-
<p className="text-lg text-foreground/80 max-w-2xl">
19-
{servicesPageContent.hero.description}
20-
</p>
21-
</div>
22-
</section>
10+
<PageHeader
11+
title={servicesPageContent.hero.title}
12+
description={servicesPageContent.hero.description}
13+
/>
2314

2415
{/* Services Grid */}
2516
<section className="py-16 md:pb-24 md:pt-10">
@@ -98,8 +89,6 @@ export default function ServicesPage() {
9889
</Button>
9990
</div>
10091
</section>
101-
102-
<Footer />
10392
</main>
10493
);
10594
}

components/common/PageHeader.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
interface IPageHeaderProps {
2+
title: string;
3+
description: string;
4+
}
5+
6+
const PageHeader = ({ title, description }: IPageHeaderProps) => {
7+
return (
8+
<section className="pt-20 pb-16 md:pt-32 md:pb-24 bg-linear-to-b from-primary/5 to-transparent">
9+
<div className="container-custom">
10+
<h1 className="heading-xl text-primary mb-6 text-balance">{title}</h1>
11+
<p className="text-lg text-foreground/80">{description}</p>
12+
</div>
13+
</section>
14+
);
15+
};
16+
17+
export default PageHeader;

components/common/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as PageHeader } from "./PageHeader";

0 commit comments

Comments
 (0)