-
-
- {book.category}
-
-
- {book.language}
-
-
-
+
+ {books.map(book => (
+
+
+
+
+
- {book.status === 'available' ? 'Available' : 'Borrowed'}
+ {book.status === 'available' ? '可借阅' : '已借出'}
-
+
+
+
+ {book.title}
+
+
+ {book.author}
+
+
+ {book.category} • {book.language}
+
+ {book.description && (
+
+ {book.description}
+
+ )}
+ {book.status === 'borrowed' && book.currentHolder && (
+
+ 当前持书人: {book.currentHolder}
+
+ )}
+
+
- View Details
-
+ 查看详情
+
- {book.status === 'borrowed' && (
-
- Currently with: {book.currentHolder}
-
- )}
-
-
-
-
- ))}
-
-
- {/* No Results */}
- {filteredBooks.length === 0 && (
-
-
No books found
-
Try adjusting your search or filters
-
- Reset All Filters
-
-
- )}
+
+
+
+ ))}
+
+
);
diff --git a/pages/open-library/donate.tsx b/pages/open-library/donate.tsx
deleted file mode 100644
index 7e54e0d..0000000
--- a/pages/open-library/donate.tsx
+++ /dev/null
@@ -1,254 +0,0 @@
-import React from 'react';
-import { Button, Card, Col, Row } from 'react-bootstrap';
-
-import { ContentContainer, Layout } from '../../components/open-library/Layout';
-
-export default function DonatePage() {
- return (
-
-
-
-
书籍募捐
-
-
-
- 为什么捐赠书籍?
-
- 您的一本书,可能会改变他人的一生。通过捐赠书籍,您不仅能够让闲置的知识重新流动,还能够帮助更多的人获取学习资源。
-
-
- 在 Open
- Library,我们相信知识应该是流动的。您捐赠的每一本书都将在社区成员之间传递,让更多人受益。当您捐赠一本书,您不仅是在分享一个物品,更是在分享知识、经验和思想。
-
-
-
-
-
-
-
-
- 捐赠流程
-
-
-
-
填写捐赠申请
-
- 填写我们的在线表单,提供您想要捐赠的书籍信息。
-
-
-
-
-
-
书籍登记
-
- 如所捐赠书籍在「fCC
- 成都社区图书馆」还未登记,请先填写书籍登记表,然后回到第
- 1 步继续捐赠。建议在移动端设备上登记,方便扫描书籍
- ISBN 码。
-
-
-
-
-
-
书籍进入图书馆
-
- 完成以上流程后,书籍正式进入 Open Library
- 的传递流程,开始流转于社区成员之间。
-
-
-
-
-
-
-
-
-
-
-
- 书籍登记
-
- 如果您要捐赠的书籍在我们的图书馆中还未登记,请先完成书籍登记流程。这有助于我们维护一个完整的书籍数据库,方便其他会员查找和借阅。
-
- 登记时,您需要提供以下信息:
-
- 书籍标题
- 作者
- ISBN(可通过扫描获取)
- 出版社
- 出版年份
- 书籍类别
- 书籍语言
- 书籍简介
- 书籍封面照片(可选)
-
-
-
-
-
-
-
-
-
- 我们接受什么样的书籍?
-
-
- ✓ 我们欢迎
-
- 技术类书籍(编程、设计、数据科学等)
- 科学类书籍
- 商业和管理类书籍
- 自我提升类书籍
- 文学和小说
- 状态良好的二手书
-
-
-
- ✗ 不适合捐赠
-
- 严重破损或缺页的书籍
- 有大量笔记或标记的书籍
- 过时的技术书籍(5年以上的技术书可能已过时)
- 教科书和习题集
- 杂志和期刊
-
-
-
-
-
-
-
-
-
-
-
-
-
- 常见问题
-
-
-
-
- 我捐赠的书籍会怎么处理?
-
-
-
-
- 您捐赠的书籍将进入我们的借阅系统,供社区成员借阅。当有人申请借阅时,书籍将从当前持有者(可能是您)直接传递给下一位借阅者。
-
-
-
-
-
-
- 我可以随时取回我捐赠的书籍吗?
-
-
-
-
- 一旦书籍捐赠给图书馆,我们视为您已将书籍所有权转让给社区。如果您希望再次阅读这本书,可以通过正常的借阅流程申请借阅。
-
-
-
-
-
-
- 如何知道我捐赠的书籍被谁借阅了?
-
-
-
-
- 您可以在我们的飞书多维表格中查看每本书的借阅记录,包括当前持有者和历史借阅情况。
-
-
-
-
-
-
- 我需要成为会员才能捐赠书籍吗?
-
-
-
-
- 是的,我们要求捐赠者成为 Open Library
- 的会员。这有助于我们建立一个基于信任的社区,并确保书籍的流转质量。
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-}
diff --git a/pages/open-library/how-to-borrow.tsx b/pages/open-library/how-to-borrow.tsx
index 3304bdd..1eb823a 100644
--- a/pages/open-library/how-to-borrow.tsx
+++ b/pages/open-library/how-to-borrow.tsx
@@ -1,6 +1,6 @@
import Link from 'next/link';
import React from 'react';
-import { Button, Card, Col, Row } from 'react-bootstrap';
+import { Card, Col, Row } from 'react-bootstrap';
import { ContentContainer, Layout } from '../../components/open-library/Layout';
diff --git a/pages/open-library/index.tsx b/pages/open-library/index.tsx
index 5853be1..b25fd4a 100644
--- a/pages/open-library/index.tsx
+++ b/pages/open-library/index.tsx
@@ -1,321 +1,231 @@
+import Head from 'next/head';
import Link from 'next/link';
import React from 'react';
-import { Button, Card, Col, Form, Image, Row, Stack } from 'react-bootstrap';
+import { Card, Col, Row } from 'react-bootstrap';
-import { ContentContainer, Layout } from '../../components/open-library/Layout';
+import FeaturedBooks from '../../components/open-library/FeaturedBooks';
+import FooterComponent from '../../components/open-library/Footer';
+import HeroSection from '../../components/open-library/HeroSection';
+import HowItWorks from '../../components/open-library/HowItWorks';
+import { ContentContainer } from '../../components/open-library/Layout';
+import LibraryNavbar from '../../components/open-library/Navbar';
+import { useOpenLibraryLayout } from '../../components/open-library/useOpenLibraryLayout';
import { t } from '../../models/Translation';
-// TODO: Define a type for Book and Testimonial
-type Book = {
- id: number;
- title: string;
- author: string;
- cover?: string; // Optional cover image URL
-};
+// Sample data - these could be moved to a separate data file in the future
+const featuredBooks = [
+ {
+ id: 1,
+ title: 'Clean Code',
+ author: 'Robert C. Martin',
+ cover: '/images/placeholder-book.svg',
+ description: '编写优雅代码的艺术',
+ status: 'available' as const,
+ rating: 4.8,
+ tags: ['编程', '软件工程'],
+ },
+ {
+ id: 2,
+ title: 'Eloquent JavaScript',
+ author: 'Marijn Haverbeke',
+ cover: '/images/placeholder-book.svg',
+ description: 'JavaScript 程序设计精粹',
+ status: 'borrowed' as const,
+ rating: 4.6,
+ tags: ['JavaScript', '前端'],
+ },
+ {
+ id: 3,
+ title: 'Design Patterns',
+ author: 'Erich Gamma et al.',
+ cover: '/images/placeholder-book.svg',
+ description: '可复用面向对象软件的基础',
+ status: 'available' as const,
+ rating: 4.7,
+ tags: ['设计模式', '软件架构'],
+ },
+ {
+ id: 4,
+ title: "You Don't Know JS",
+ author: 'Kyle Simpson',
+ cover: '/images/placeholder-book.svg',
+ description: 'JavaScript 深度解析系列',
+ status: 'available' as const,
+ rating: 4.5,
+ tags: ['JavaScript', '进阶'],
+ },
+];
-type Testimonial = {
- id: number;
- name: string;
- quote: string;
-};
+const workflowSteps = [
+ {
+ id: 1,
+ icon: 'bi-search',
+ title: '浏览图书',
+ description: '在图书目录中寻找你感兴趣的书籍',
+ color: '#6f42c1',
+ },
+ {
+ id: 2,
+ icon: 'bi-file-earmark-text',
+ title: '申请借阅',
+ description: '填写借阅申请表单,说明你的借阅意向',
+ color: '#0d6efd',
+ },
+ {
+ id: 3,
+ icon: 'bi-people',
+ title: '联系持书人',
+ description: '我们会协助你联系当前的持书人安排交接',
+ color: '#fd7e14',
+ },
+ {
+ id: 4,
+ icon: 'bi-book-half',
+ title: '传递分享',
+ description: '阅读完成后,将书籍传递给下一位读者',
+ color: '#198754',
+ },
+];
export default function OpenLibraryHomepage() {
- // Sample featured books data
- const featuredBooks: Book[] = [
- {
- id: 1,
- title: 'Clean Code',
- author: 'Robert C. Martin',
- cover: '/images/placeholder-book.svg',
- }, // TODO: Replace placeholder path
- {
- id: 2,
- title: 'Eloquent JavaScript',
- author: 'Marijn Haverbeke',
- cover: '/images/placeholder-book.svg',
- },
- {
- id: 3,
- title: 'Design Patterns',
- author: 'Erich Gamma et al.',
- cover: '/images/placeholder-book.svg',
- },
- {
- id: 4,
- title: "You Don't Know JS",
- author: 'Kyle Simpson',
- cover: '/images/placeholder-book.svg',
- },
- ];
-
- // Sample testimonials data
- const testimonials: Testimonial[] = [
- {
- id: 1,
- name: 'Zhang Wei',
- quote:
- "Open Library helped me discover amazing tech books I couldn't find elsewhere.",
- },
- {
- id: 2,
- name: 'Li Mei',
- quote:
- "The community is so supportive. I've both borrowed and donated books here.",
- },
- {
- id: 3,
- name: 'Wang Chen',
- quote:
- 'As a student, this resource has been invaluable for my studies in computer science.',
- },
- ];
+ // Apply Open Library layout styles
+ useOpenLibraryLayout();
return (
-
-
- {/* --- Hero Section --- */}
-
-
-
-
- {t('hero_title')}
- {t('hero_subtitle')}
- {/* TODO: Link this button to the actual Feishu form or member sign-up page */}
-
- {t('become_member')}
-
-
-
- {/* TODO: Replace placeholder */}
-
-
-
-
-
+ <>
+
+ {`${t('open_library')} - freeCodeCamp 成都社区`}
+
+
- {/* --- Featured Books Section --- */}
-
-
-
- {t('featured_books')}
-
-
- {t('featured_books_subtitle')}
-
-
- {featuredBooks.map(book => (
- // TODO: Potentially move Card rendering to components/open-library/BookCard.tsx
-
-
-
-
-
-
-
- {book.title}
-
-
- {book.author}
-
-
-
-
- {t('view_details')}
-
-
-
-
-
-
- ))}
-
-
-
-
- {t('view_all_books')} →
-
-
+
+
+
+
+
+ {/* About Section */}
+
+
+
+
+ 📚 关于我们
+
+
+ freeCodeCamp 成都社区「Open Library」开放共享图书馆
+
-
-
- {/* --- Donation Callout Section --- */}
-
-
-
-
- {t('share_your_knowledge')}
- {t('donation_callout_subtitle')}
-
- {t('donate_a_book')}
-
+
+
+
+
+ 🌟 我们的使命
+
+ 促进知识交流,推动社区成员之间的学习和成长,增强社区成员之间的互动与信任。
+ 我们采用独特的"无储存"借阅模式,让书籍在会员之间自由流转。
+
+
+
-
- {/* TODO: Replace placeholder */}
-
+
+
+
+ 💡 核心理念
+
+
+ ✦ 知识流动 - 书籍自由流转,促进知识传播
+
+
+ ✦ 社区驱动 - 所有书籍来自成员捐赠
+
+
+ ✦ 开放共享 - 促进交流和互动
+
+
+
+
-
-
+
+
- {/* --- How It Works Section --- */}
-
+ {/* Featured Books Section */}
+
- {t('how_it_works')}
-
- {t('how_it_works_description')}
-
-
-
-
-
-
- {t('step_1_find_book')}
- {t('step_1_description')}
-
-
-
-
-
- {t('step_2_apply')}
- {t('step_2_description')}
-
-
-
-
-
- {t('step_3_receive')}
- {t('step_3_description')}
-
-
-
-
-
- {t('learn_more_about_borrowing')}
-
-
+
+
+ 📖 精选图书
+
+
发现社区成员推荐的优质图书
+
-
+
+
+
+
+
- {/* --- Testimonials Section --- */}
-
+ {/* Simple Donation Section */}
+
-
- {t('community_voices')}
-
-
- {t('community_voices_description')}
-
-
- {testimonials.map(testimonial => (
-
-
-
-
- "{testimonial.quote}"
-
-
-
-
-
- ))}
-
-
-
-
+ 💖 支持我们
+
+ Open Library
+ 完全由社区成员的热情和贡献支撑。如果这个项目对你有帮助,
+
+ 欢迎通过以下方式支持我们的发展。
+
+
-
-
- {/* --- Newsletter Section --- */}
-
-
-
-
-
-
- {t('stay_updated')}
-
- {t('newsletter_description')}
-
- {/* TODO: Implement actual newsletter subscription logic */}
-
-
-
-
-
-
-
+
-
+
+
+ >
);
}
diff --git a/pages/open-library/review.tsx b/pages/open-library/review.tsx
deleted file mode 100644
index 28222cf..0000000
--- a/pages/open-library/review.tsx
+++ /dev/null
@@ -1,372 +0,0 @@
-import React, { useState } from 'react';
-import { Button, Card, Col, Form, Row, Tab, Tabs } from 'react-bootstrap';
-
-import { ContentContainer, Layout } from '../../components/open-library/Layout';
-
-// Review type definition
-type Review = {
- id: number;
- bookTitle: string;
- bookAuthor: string;
- bookCover?: string;
- reviewer: string;
- rating: number;
- comment: string;
- date: string;
-};
-
-export default function ReviewPage() {
- // Sample reviews data - in a real app, this would come from an API
- const [reviews, setReviews] = useState([
- {
- id: 1,
- bookTitle: 'Clean Code',
- bookAuthor: 'Robert C. Martin',
- bookCover: '/images/placeholder-book.svg',
- reviewer: 'Wang Chen',
- rating: 5,
- comment:
- 'This book completely changed how I approach writing code. Highly recommended for all developers!',
- date: '2023-11-25',
- },
- {
- id: 2,
- bookTitle: 'Clean Code',
- bookAuthor: 'Robert C. Martin',
- bookCover: '/images/placeholder-book.svg',
- reviewer: 'Li Mei',
- rating: 4,
- comment:
- 'Great principles that have stood the test of time. Some examples are a bit dated but the concepts are solid.',
- date: '2023-09-10',
- },
- {
- id: 3,
- bookTitle: 'Eloquent JavaScript',
- bookAuthor: 'Marijn Haverbeke',
- bookCover: '/images/placeholder-book.svg',
- reviewer: 'Liu Jie',
- rating: 5,
- comment:
- 'Perfect for beginners and intermediate JavaScript developers. The exercises are particularly helpful.',
- date: '2023-12-05',
- },
- {
- id: 4,
- bookTitle: 'Design Patterns',
- bookAuthor: 'Erich Gamma et al.',
- bookCover: '/images/placeholder-book.svg',
- reviewer: 'Chen Ming',
- rating: 4,
- comment:
- 'A classic that has stood the test of time. The examples are in C++ and Smalltalk, but the concepts apply to any OO language.',
- date: '2023-07-25',
- },
- {
- id: 5,
- bookTitle: '深入理解计算机系统',
- bookAuthor: 'Randal E. Bryant',
- bookCover: '/images/placeholder-book.svg',
- reviewer: 'Zhang Wei',
- rating: 5,
- comment:
- '这是一本非常全面的计算机系统书籍,对理解计算机底层工作原理非常有帮助。',
- date: '2023-10-15',
- },
- ]);
-
- // Function to render star rating
- const renderStars = (rating: number) => {
- return (
-
- {[...Array(5)].map((_, i) => (
-
- {i < rating ? '\u2605' : '\u2606'}
-
- ))}
-
- );
- };
-
- return (
-
-
-
-
书籍评价
-
-
-
- 社区书评
-
- 阅读是一种体验,分享让这种体验更加丰富。浏览社区成员的书评,或者分享您自己的阅读感受。
-
-
-
- 写书评
-
-
-
-
-
-
-
-
- {reviews.map(review => (
-
-
-
-
-
-
-
{review.bookTitle}
-
- {review.bookAuthor}
-
-
-
-
-
-
{review.reviewer}
- {renderStars(review.rating)}
-
- {review.comment}
-
-
- {new Date(review.date).toLocaleDateString(
- 'en-US',
- {
- year: 'numeric',
- month: '2-digit',
- day: '2-digit',
- },
- )}
-
-
- 查看书籍详情
-
-
-
-
-
-
- ))}
-
-
-
-
- {reviews
- .sort(
- (a, b) =>
- new Date(b.date).getTime() - new Date(a.date).getTime(),
- )
- .slice(0, 3)
- .map(review => (
-
-
-
-
-
-
-
- {review.bookTitle}
-
-
- {review.bookAuthor}
-
-
-
-
-
-
{review.reviewer}
- {renderStars(review.rating)}
-
- {review.comment}
-
-
- {new Date(review.date).toLocaleDateString(
- 'en-US',
- {
- year: 'numeric',
- month: '2-digit',
- day: '2-digit',
- },
- )}
-
-
- 查看书籍详情
-
-
-
-
-
-
- ))}
-
-
-
-
- {reviews
- .filter(review => review.rating >= 5)
- .map(review => (
-
-
-
-
-
-
-
- {review.bookTitle}
-
-
- {review.bookAuthor}
-
-
-
-
-
-
{review.reviewer}
- {renderStars(review.rating)}
-
- {review.comment}
-
-
- {new Date(review.date).toLocaleDateString(
- 'en-US',
- {
- year: 'numeric',
- month: '2-digit',
- day: '2-digit',
- },
- )}
-
-
- 查看书籍详情
-
-
-
-
-
-
- ))}
-
-
-
-
-
-
- 写下您的书评
-
- 阅读完一本书后,请花几分钟时间分享您的阅读体验。您的评价将帮助其他社区成员找到适合他们的书籍。
-
-
-
- 写书评
-
-
-
-
-
-
-
- 书评指南
-
-
- 如何写一篇有帮助的书评
-
- 简要概述书籍内容,但不要透露关键情节
- 分享您从书中获得的主要收获
- 提及书籍的优点和可能的缺点
- 说明适合阅读这本书的人群
- 分享书中让您印象深刻的观点或引用
-
-
-
- 评分参考
-
-
-
-
★★★★★
-
杰出,强烈推荐,改变思维的书籍
-
-
-
-
-
★★★★☆
-
非常好,值得推荐,有一些小缺点
-
-
-
-
-
-
-
-
★★☆☆☆
-
一般,有一些有用信息,但整体平淡
-
-
-
-
-
★☆☆☆☆
-
不推荐,内容质量较低或不准确
-
-
-
-
-
-
-
-
-
-
- );
-}