Skip to content

Commit acb33f8

Browse files
✨ feat(books-classes): refactor pages and adjust for headerstyle consistency
1 parent 2d2d93f commit acb33f8

8 files changed

Lines changed: 453 additions & 184 deletions

File tree

content/books/sample-book.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
title: "Clean Code"
33
authorName: "Robert C. Martin"
4-
link: "https://www.oreilly.com/library/view/clean-code-a/9780136083238/"
5-
image: "https://m.media-amazon.com/images/I/41xShlnTZTL._SX374_BO1,204,203,200_.jpg"
6-
authorEmail: "unclebob@example.com"
7-
authorLink: "https://blog.cleancoder.com/"
4+
link: https://www.oreilly.com/library/view/clean-code-a/9780136083238/
5+
image: https://m.media-amazon.com/images/I/41xShlnTZTL._SX374_BO1,204,203,200_.jpg
6+
authorEmail: unclebob@example.com
7+
authorLink: https://blog.cleancoder.com/
88
---
99

1010
Recommended software craftsmanship reading.

messages/en.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,16 @@
358358
"title": "Profiles",
359359
"subtitle": "Discover {count}+ software engineers from Myanmar. Browse by technology, search by name, and connect with the community."
360360
},
361+
"booksHero": {
362+
"label": "Tech Books & Resources",
363+
"title": "Books",
364+
"subtitle": "Recommended tech books and learning resources shared by Myanmar software engineers."
365+
},
366+
"classesHero": {
367+
"label": "Tech Classes & Workshops",
368+
"title": "Classes",
369+
"subtitle": "A trust-first, community-curated directory of tech classes in Myanmar. Listings are reviewed before publication."
370+
},
361371
"footer": {
362372
"tagline": {
363373
"prefix": "Empowering Myanmar's Software Engineers to ",

messages/mm.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,16 @@
358358
"title": "ပရိုဖိုင်များ",
359359
"subtitle": "မြန်မာမှ ဆော့ဖ်ဝဲ အင်ဂျင်နီယာ {count}+ ဦးကို ရှာဖွေပါ။ နည်းပညာအလိုက် ရှာဖွေပါ၊ အမည်ဖြင့် ရှာပါ၊ အသိုင်းအဝိုင်းနှင့် ချိတ်ဆက်ပါ။"
360360
},
361+
"booksHero": {
362+
"label": "နည်းပညာ စာအုပ်များနှင့် အရင်းအမြစ်များ",
363+
"title": "စာအုပ်များ",
364+
"subtitle": "မြန်မာ software engineer များ မျှဝေထားသော နည်းပညာစာအုပ်များနှင့် လေ့လာရေးအရင်းအမြစ်များကို ရှာဖွေပါ။"
365+
},
366+
"classesHero": {
367+
"label": "နည်းပညာ သင်တန်းများနှင့် အလုပ်ရုံဆွေးနွေးပွဲများ",
368+
"title": "သင်တန်းများ",
369+
"subtitle": "ယုံကြည်စိတ်ချရမှုကို အခြေခံထားသော မြန်မာနည်းပညာသင်တန်းများ စာရင်းဖြစ်ပြီး၊ စာရင်းတင်သွင်းမှုများကို မထုတ်ပြန်မီ စစ်ဆေးအတည်ပြုပါသည်။"
370+
},
361371
"footer": {
362372
"tagline": {
363373
"prefix": "မြန်မာ့ ဆော့ဖ်ဝဲ အင်ဂျင်နီယာများကို ",

src/app/books/BooksPageClient.tsx

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
"use client";
2+
3+
import Container from "@/components/Common/Container/Container";
4+
import SectionHero from "@/components/Common/SectionHero/SectionHero";
5+
import SpacingDivider from "@/components/Common/SpacingDivider/SpacingDivider";
6+
import { BookOpen, Bookmark, LibraryBig, NotebookPen } from "lucide-react";
7+
import { useTranslations } from "next-intl";
8+
9+
type BookItem = {
10+
_id: string;
11+
title: string;
12+
authorName: string;
13+
authorEmail?: string;
14+
authorLink?: string;
15+
image?: string;
16+
link: string;
17+
};
18+
19+
type BooksPageClientProps = {
20+
books: BookItem[];
21+
};
22+
23+
const BooksPageClient = ({ books }: BooksPageClientProps) => {
24+
const t = useTranslations("booksHero");
25+
26+
return (
27+
<Container>
28+
<section className="py-16">
29+
<SectionHero
30+
label={t("label")}
31+
title={t("title")}
32+
subtitle={t("subtitle")}
33+
labelIcon={NotebookPen}
34+
labelIconClassName="text-prism-violet"
35+
labelChipBackground="linear-gradient(135deg, #a78bfa12, #22d3ee08)"
36+
labelChipBorder="1px solid rgba(167,139,250,0.15)"
37+
shimmerBackground="linear-gradient(90deg, transparent 0%, rgba(167,139,250,0.1) 50%, transparent 100%)"
38+
myanmarTitleColorClass="text-prism-violet"
39+
floatingIcons={[
40+
{
41+
Icon: BookOpen,
42+
className: "text-prism-violet/40",
43+
style: { top: "8%", right: "6%" },
44+
delay: 0.25,
45+
sizeClass: "h-4 w-4",
46+
},
47+
{
48+
Icon: LibraryBig,
49+
className: "text-prism-cyan/40",
50+
style: { top: "65%", right: "14%" },
51+
delay: 0.35,
52+
sizeClass: "h-3.5 w-3.5",
53+
},
54+
{
55+
Icon: Bookmark,
56+
className: "text-prism-rose/35",
57+
style: { top: "80%", left: "3%" },
58+
delay: 0.45,
59+
sizeClass: "h-3.5 w-3.5",
60+
},
61+
]}
62+
/>
63+
64+
{books.length === 0 ? (
65+
<div className="mt-12 rounded-3xl border border-white/10 bg-surface/50 p-8 text-zinc-300">
66+
<h2 className="font-display text-2xl font-semibold text-zinc-100">
67+
No books yet
68+
</h2>
69+
<p className="mt-3 max-w-2xl text-sm leading-6 text-zinc-400">
70+
Community recommendations will appear here once contributors add
71+
book entries to the repository.
72+
</p>
73+
</div>
74+
) : (
75+
<div className="mt-12 grid gap-4">
76+
{books.map((book) => (
77+
<article
78+
key={book._id}
79+
className="rounded-3xl border border-white/10 bg-surface/50 p-6 transition-colors hover:border-white/20"
80+
>
81+
<div className="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
82+
<div className="flex flex-col gap-4 sm:flex-row sm:items-start">
83+
{book.image && (
84+
<img
85+
src={book.image}
86+
alt={`${book.title} cover`}
87+
className="h-32 w-24 rounded-xl border border-white/10 object-cover"
88+
/>
89+
)}
90+
91+
<div>
92+
<h2 className="font-display text-2xl font-semibold text-zinc-100">
93+
{book.title}
94+
</h2>
95+
<p className="mt-2 text-sm text-zinc-400">
96+
by {book.authorName}
97+
</p>
98+
{(book.authorEmail || book.authorLink) && (
99+
<div className="mt-3 flex flex-col gap-2 text-sm">
100+
{book.authorEmail && (
101+
<a
102+
href={`mailto:${book.authorEmail}`}
103+
className="text-zinc-400 transition-colors hover:text-prism-cyan"
104+
>
105+
{book.authorEmail}
106+
</a>
107+
)}
108+
{book.authorLink && (
109+
<a
110+
href={book.authorLink}
111+
target="_blank"
112+
rel="noopener noreferrer"
113+
className="text-zinc-400 transition-colors hover:text-prism-cyan"
114+
>
115+
{book.authorLink}
116+
</a>
117+
)}
118+
</div>
119+
)}
120+
</div>
121+
</div>
122+
123+
<a
124+
href={book.link}
125+
target="_blank"
126+
rel="noopener noreferrer"
127+
className="inline-flex items-center justify-center rounded-full border border-prism-cyan/40 px-4 py-2 text-sm font-medium text-prism-cyan transition-colors hover:border-prism-cyan hover:bg-prism-cyan/10"
128+
>
129+
Open Resource
130+
</a>
131+
</div>
132+
</article>
133+
))}
134+
</div>
135+
)}
136+
</section>
137+
138+
<SpacingDivider size="lg" />
139+
</Container>
140+
);
141+
};
142+
143+
export default BooksPageClient;

src/app/books/page.tsx

Lines changed: 2 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import PageTransitionWrapper from "@/components/Animate/PageTransitionWrapper/PageTransitionWrapper";
2-
import Container from "@/components/Common/Container/Container";
3-
import SpacingDivider from "@/components/Common/SpacingDivider/SpacingDivider";
42
import APP_CONFIG from "@/config/config";
53
import { allBooks } from "contentlayer/generated";
64
import { Metadata } from "next";
5+
import BooksPageClient from "./BooksPageClient";
76

87
export const metadata: Metadata = {
98
title: `Books | ${APP_CONFIG.title}`,
@@ -22,97 +21,7 @@ const BooksPage = async () => {
2221

2322
return (
2423
<PageTransitionWrapper>
25-
<Container>
26-
<section className="py-16">
27-
<div className="max-w-3xl">
28-
<p className="font-mono text-xs uppercase tracking-[0.25em] text-zinc-500">
29-
Community Library
30-
</p>
31-
<h1 className="mt-4 font-display text-4xl font-bold text-zinc-100 sm:text-5xl">
32-
Books
33-
</h1>
34-
<p className="mt-4 max-w-2xl text-base leading-7 text-zinc-400">
35-
Recommended tech books and learning resources shared by Myanmar
36-
software engineers.
37-
</p>
38-
</div>
39-
40-
{books.length === 0 ? (
41-
<div className="mt-12 rounded-3xl border border-white/10 bg-surface/50 p-8 text-zinc-300">
42-
<h2 className="font-display text-2xl font-semibold text-zinc-100">
43-
No books yet
44-
</h2>
45-
<p className="mt-3 max-w-2xl text-sm leading-6 text-zinc-400">
46-
Community recommendations will appear here once contributors add
47-
book entries to the repository.
48-
</p>
49-
</div>
50-
) : (
51-
<div className="mt-12 grid gap-4">
52-
{books.map((book) => (
53-
<article
54-
key={book._id}
55-
className="rounded-3xl border border-white/10 bg-surface/50 p-6 transition-colors hover:border-white/20"
56-
>
57-
<div className="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
58-
<div className="flex flex-col gap-4 sm:flex-row sm:items-start">
59-
{book.image && (
60-
<img
61-
src={book.image}
62-
alt={`${book.title} cover`}
63-
className="h-32 w-24 rounded-xl border border-white/10 object-cover"
64-
/>
65-
)}
66-
67-
<div>
68-
<h2 className="font-display text-2xl font-semibold text-zinc-100">
69-
{book.title}
70-
</h2>
71-
<p className="mt-2 text-sm text-zinc-400">
72-
by {book.authorName}
73-
</p>
74-
{(book.authorEmail || book.authorLink) && (
75-
<div className="mt-3 flex flex-col gap-2 text-sm">
76-
{book.authorEmail && (
77-
<a
78-
href={`mailto:${book.authorEmail}`}
79-
className="text-zinc-400 transition-colors hover:text-prism-cyan"
80-
>
81-
{book.authorEmail}
82-
</a>
83-
)}
84-
{book.authorLink && (
85-
<a
86-
href={book.authorLink}
87-
target="_blank"
88-
rel="noopener noreferrer"
89-
className="text-zinc-400 transition-colors hover:text-prism-cyan"
90-
>
91-
{book.authorLink}
92-
</a>
93-
)}
94-
</div>
95-
)}
96-
</div>
97-
</div>
98-
99-
<a
100-
href={book.link}
101-
target="_blank"
102-
rel="noopener noreferrer"
103-
className="inline-flex items-center justify-center rounded-full border border-prism-cyan/40 px-4 py-2 text-sm font-medium text-prism-cyan transition-colors hover:border-prism-cyan hover:bg-prism-cyan/10"
104-
>
105-
Open Resource
106-
</a>
107-
</div>
108-
</article>
109-
))}
110-
</div>
111-
)}
112-
</section>
113-
114-
<SpacingDivider size="lg" />
115-
</Container>
24+
<BooksPageClient books={books} />
11625
</PageTransitionWrapper>
11726
);
11827
};

0 commit comments

Comments
 (0)