parent
792643adb1
commit
bacb9b8e5c
|
|
@ -51,7 +51,7 @@ function Pagination({ current = 3, total, size, onClick }: PaginationProps) {
|
|||
<div>
|
||||
{arr.map((item, index) => {
|
||||
if (typeof item === "string") {
|
||||
return <span className="p-2 mr-2">{item}</span>
|
||||
return <span key={index} className="p-2 mr-2">{item}</span>
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import type { LinksFunction } from "@remix-run/node";
|
||||
import {
|
||||
Links,
|
||||
LiveReload,
|
||||
Meta,
|
||||
Outlet,
|
||||
Scripts,
|
||||
|
|
@ -76,7 +75,6 @@ export default function App() {
|
|||
<Outlet />
|
||||
<Footer />
|
||||
<ScrollRestoration />
|
||||
<LiveReload />
|
||||
<Scripts />
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -27,10 +27,6 @@ export default function Note() {
|
|||
const [params, setParams] = useSearchParams();
|
||||
const { note, page, year } = useLoaderData<typeof loader>();
|
||||
|
||||
useEffect(() => {
|
||||
console.log(note);
|
||||
}, []);
|
||||
|
||||
const onChangeYear = (ev: ChangeEvent<HTMLSelectElement>) => {
|
||||
navigate({
|
||||
search: `?year=${ev.target.value}`,
|
||||
|
|
@ -88,7 +84,7 @@ export default function Note() {
|
|||
onChange={onChangeYear}
|
||||
>
|
||||
{years.map((year) => (
|
||||
<option value={year}>{year} 年</option>
|
||||
<option key={year} value={year}>{year} 年</option>
|
||||
))}
|
||||
</select>
|
||||
<Pagination current={Number(page)} size={7} total={note.count} onClick={onChangePage} />
|
||||
|
|
|
|||
18
package.json
18
package.json
|
|
@ -15,17 +15,17 @@
|
|||
"typecheck": "tsc"
|
||||
},
|
||||
"dependencies": {
|
||||
"@remix-run/node": "^2.7.1",
|
||||
"@remix-run/react": "^2.7.1",
|
||||
"@remix-run/serve": "^2.7.1",
|
||||
"@remix-run/node": "^2.10.2",
|
||||
"@remix-run/react": "^2.10.2",
|
||||
"@remix-run/serve": "^2.10.2",
|
||||
"isbot": "^4.1.0",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0"
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@remix-run/dev": "^2.7.1",
|
||||
"@types/react": "^18.2.20",
|
||||
"@types/react-dom": "^18.2.7",
|
||||
"@remix-run/dev": "^2.10.2",
|
||||
"@types/react": "^18.3.3",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"@typescript-eslint/eslint-plugin": "^6.7.4",
|
||||
"autoprefixer": "^10.4.16",
|
||||
"eslint": "^8.38.0",
|
||||
|
|
@ -42,6 +42,6 @@
|
|||
"vite-tsconfig-paths": "^4.2.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
"node": ">=20.0.0"
|
||||
}
|
||||
}
|
||||
8390
pnpm-lock.yaml
8390
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue