Skip to content

Commit bd5f955

Browse files
committed
refactor: update page titles and links for consistent branding and navigation
1 parent 025cfa4 commit bd5f955

File tree

4 files changed

+20
-34
lines changed

4 files changed

+20
-34
lines changed

app/not-found.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import PageTitle from "@/components/PageTitle";
22
import Link from "next/link";
33

44
export const metadata = {
5-
title: "Page not found | Fyrre Magazine",
5+
title: "Page not found | L.A.P",
66
description: "Page does not exist",
77
};
88

app/posts/[title]/page.tsx

+15-22
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ export async function generateMetadata({
3535
const snapshot = await getDocs(q);
3636

3737
if (snapshot.empty) {
38-
return { title: "Article Not Found | Fyrre Magazine" };
38+
return { title: "Article Not Found | L.A.P" };
3939
}
4040

4141
const articleData = snapshot.docs[0].data();
4242
return {
43-
title: `${articleData.title} | Fyrre Magazine`,
43+
title: `${articleData.title} | L.A.P`,
4444
};
4545
} catch (error) {
4646
return {
47-
title: "Error Loading Article | Fyrre Magazine",
47+
title: "Error Loading Article | L.A.P",
4848
};
4949
}
5050
}
@@ -95,14 +95,7 @@ export default async function ArticleDetails({
9595
...contentItem,
9696
...(contentItem.date && { date: contentItem.date.toDate() })
9797
})),
98-
title: "",
99-
slug: "",
100-
read: "",
101-
label: "",
102-
img: "",
103-
imgAlt: "",
104-
description: "",
105-
authorUID: ""
98+
authorUID: articleData.authorUID
10699
};
107100

108101
// Get latest articles (excluding current)
@@ -136,7 +129,7 @@ export default async function ArticleDetails({
136129

137130
return (
138131
<main className="max-w-[95rem] w-full mx-auto px-4 md:pt-8 sm:pt-4 xs:pt-2 lg:pb-4 md:pb-4 sm:pb-2 xs:pb-2">
139-
<PostNavigation href="/magazine">POSTS</PostNavigation>
132+
<PostNavigation href="/posts">POSTS</PostNavigation>
140133

141134
<article className="grid md:grid-cols-2 gap-6 md:gap-6 pb-6 md:pb-24">
142135
<h2 className="text-subtitle">{processedArticle.title}</h2>
@@ -164,7 +157,7 @@ export default async function ArticleDetails({
164157
<p>{processedArticle.read}</p>
165158
</span>
166159
</div>
167-
<span className="px-3 py-2 border border-black rounded-full w-fit h-fit">
160+
<span className="px-3 py-2 border border-white rounded-full w-fit h-fit">
168161
<p className="uppercase">{processedArticle.label}</p>
169162
</span>
170163
</div>
@@ -177,7 +170,7 @@ export default async function ArticleDetails({
177170
/>
178171
</div>
179172

180-
<article className="flex flex-col md:flex-row gap-6 md:gap-16 max-w-[62.5rem] w-full mx-auto mt-6 md:mt-24">
173+
<article className="flex flex-col md:flex-row gap-6 md:gap-16 max-w-[62.5rem] w-full mx-auto mt-6 md:mt-24 mb-10">
181174
<div className="flex flex-col w-fit">
182175
<div className="flex gap-4 items-center">
183176
<img
@@ -203,7 +196,7 @@ export default async function ArticleDetails({
203196
<p className="font-semibold">Read</p>
204197
<p>{processedArticle.read}</p>
205198
</div>
206-
<div className="flex flex-wrap justify-between">
199+
{/* <div className="flex flex-wrap justify-between">
207200
<p className="flex font-semibold">Share</p>
208201
<SocialSharing
209202
links={[
@@ -239,7 +232,7 @@ export default async function ArticleDetails({
239232
},
240233
]}
241234
/>
242-
</div>
235+
</div> */}
243236
</div>
244237
</div>
245238

@@ -277,16 +270,16 @@ export default async function ArticleDetails({
277270
<div>
278271
<Subheading
279272
className="text-subheading"
280-
url="/magazine"
273+
url="/posts"
281274
linkText="See all"
282275
>
283276
Latest Posts
284277
</Subheading>
285278

286-
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 border border-black border-collapse mb-12 md:mb-48">
279+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 border border-white border-collapse mb-12 md:mb-48">
287280
{latestArticles.map((article) => (
288281
<article
289-
className="border border-black p-8"
282+
className="border border-white p-8"
290283
key={article.id}
291284
>
292285
<div className="flex items-center justify-between">
@@ -297,19 +290,19 @@ export default async function ArticleDetails({
297290
day: "numeric",
298291
})}
299292
</time>
300-
<span className="px-3 py-2 border border-black rounded-full">
293+
<span className="px-3 py-2 border border-white rounded-full">
301294
<p className="uppercase">{article.label}</p>
302295
</span>
303296
</div>
304-
<Link href={`/magazine/${article.slug}`}>
297+
<Link href={`/posts/${article.slug}`}>
305298
<img
306299
className="w-full my-8 hover:scale-105 transition-transform"
307300
src={article.img}
308301
alt={article.imgAlt}
309302
/>
310303
</Link>
311304
<h2 className="heading3-title mb-3">
312-
<Link href={`/magazine/${article.slug}`}>
305+
<Link href={`/posts/${article.slug}`}>
313306
{article.title}
314307
</Link>
315308
</h2>

components/PopularArticles.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default function PopularArticles() {
4747
<p className="text-2xl font-semibold">{`0${index + 1}`}</p>
4848
<article className="flex flex-col gap-4">
4949
<h3 className="text-2xl font-semibold">
50-
<Link href={`/magazine/${article.slug}`}>{article.title}</Link>
50+
<Link href={`/posts/${article.slug}`}>{article.title}</Link>
5151
</h3>
5252
<span className="flex gap-2">
5353
<p className="font-semibold">Author:</p>

components/PostNavigation.tsx

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,19 @@
11
import Link from "next/link";
2+
import { RiArrowRightLine } from "react-icons/ri"; // Importing Right Arrow Icon
23

34
type PostNavigationProps = {
45
children: React.ReactNode;
5-
className?: string;
66
href: string;
77
};
88

9-
export default function PostNavigation({
10-
children,
11-
href,
12-
}: PostNavigationProps) {
9+
export default function PostNavigation({ children, href }: PostNavigationProps) {
1310
return (
1411
<div className="flex items-center justify-between py-4 md:pt-8 md:pb-24">
1512
<Link
1613
className="flex items-center gap-2 uppercase font-semibold w-full"
1714
href={href}
1815
>
19-
<img
20-
className="rotate-180"
21-
src="/icons/ri_arrow-right-line.svg"
22-
alt="Right arrow"
23-
/>
16+
<RiArrowRightLine className="rotate-180 text-2xl" />
2417
Go Back
2518
</Link>
2619
<p className="uppercase font-semibold text-lg md:text-[2rem]">

0 commit comments

Comments
 (0)