Skip to content

Commit 23870d8

Browse files
committed
fix: replace <a> tags with Next.js <Link> components and fix TypeScript errors
1 parent a72c2ee commit 23870d8

3 files changed

Lines changed: 15 additions & 11 deletions

File tree

components/open-library/Navbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import dynamic from 'next/dynamic';
22
import React from 'react';
3-
import { Button, Form, FormControl, Nav, Navbar } from 'react-bootstrap';
3+
import { Nav, Navbar } from 'react-bootstrap';
44

55
import { t } from '../../models/Translation';
66

pages/open-library/books/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ export default function BookCatalog() {
124124
const [statusFilter, setStatusFilter] = useState('');
125125

126126
// Extract unique categories and languages for filter dropdowns
127-
const categories = [...new Set(books.map(book => book.category))];
128-
const languages = [...new Set(books.map(book => book.language))];
127+
const categories = Array.from(new Set(books.map(book => book.category)));
128+
const languages = Array.from(new Set(books.map(book => book.language)));
129129

130130
// Apply filters when any filter changes
131131
useEffect(() => {

pages/open-library/how-to-borrow.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import Link from 'next/link';
12
import React from 'react';
23
import { Button, Card, Col, Row } from 'react-bootstrap';
34

@@ -61,7 +62,10 @@ export default function HowToBorrowPage() {
6162
fCC 成都社区图书馆
6263
</a>{' '}
6364
中查找自己感兴趣的书籍,或者在我们的{' '}
64-
<a href="/open-library/books">书籍目录</a> 中浏览。
65+
<Link href="/open-library/books" legacyBehavior>
66+
<a>书籍目录</a>
67+
</Link>{' '}
68+
中浏览。
6569
</p>
6670
</div>
6771
</div>
@@ -214,9 +218,9 @@ export default function HowToBorrowPage() {
214218
>
215219
填写书籍传递表
216220
</a>
217-
<a href="/open-library/books" className="btn btn-primary">
218-
浏览书籍目录
219-
</a>
221+
<Link href="/open-library/books" legacyBehavior>
222+
<a className="btn btn-primary">浏览书籍目录</a>
223+
</Link>
220224
</div>
221225
</Card.Body>
222226
</Card>
@@ -274,14 +278,14 @@ export default function HowToBorrowPage() {
274278
<div className="text-center">
275279
<h3 className="mb-4">准备好借阅了吗?</h3>
276280
<div className="d-flex justify-content-center gap-3 flex-wrap">
277-
<a href="/open-library/books" className="btn btn-primary btn-lg">
278-
浏览书籍目录
279-
</a>
281+
<Link href="/open-library/books" legacyBehavior>
282+
<a className="btn btn-primary btn-lg">浏览书籍目录</a>
283+
</Link>
280284
<a
281285
href="https://open-source-bazaar.feishu.cn/share/base/form/shrcngQgMrhjTh6ycO1zcaEWZld"
282286
target="_blank"
283287
rel="noopener noreferrer"
284-
className="btn btn-outline-primary btn-lg"
288+
className="btn btn-warning btn-lg"
285289
>
286290
申请成为会员
287291
</a>

0 commit comments

Comments
 (0)