Skip to content

Commit d2abe89

Browse files
committed
fetcherの型修正+list-disc,list-decimalの削除
1 parent 78b6a81 commit d2abe89

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

app/sidebar.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
"use client";
22
import Link from "next/link";
33
import { usePathname } from "next/navigation";
4-
import useSWR from 'swr'
4+
import useSWR, { Fetcher } from 'swr'
55
import { splitMarkdown } from "./[docs_id]/splitMarkdown";
66

7-
7+
const fetcher: Fetcher<string, string> = (url) => fetch(url).then((r) => r.text())
88

99
export function Sidebar() {
10-
const fetcher = (url: string | URL | Request<unknown, CfProperties<unknown>>) => fetch(url).then((r) => r.text())
1110
const pathname = usePathname();
1211
const docs_id = pathname.replace(/^\//, "");
1312
const { data, error, isLoading } = useSWR(
@@ -30,7 +29,6 @@ export function Sidebar() {
3029
{ id: "python-9", title: "9. ジェネレータとデコレータ" },
3130
];
3231

33-
3432
const splitmdcontent = splitMarkdown(data ?? "")
3533
return (
3634
<div className="bg-base-200 min-h-full w-80 p-4">
@@ -40,12 +38,12 @@ export function Sidebar() {
4038
Navbar Title
4139
</h2>
4240

43-
<ol className="menu w-full list-decimal list-outside">
41+
<ol className="menu w-full list-outside">
4442
{pages.map((page) => (
4543
<li key={page.id}>
4644
<Link href={`/${page.id}`}>{page.title}</Link>
4745
{page.id === docs_id && (
48-
<ul className="ml-4 mt-2 list-disc text-sm">
46+
<ul className="ml-4 mt-2 text-sm">
4947
{splitmdcontent
5048
.filter(section => section.level !== 1)
5149
.map((section, idx) => (

0 commit comments

Comments
 (0)