Skip to content

Commit 860e9f9

Browse files
committed
フレンズをdaisyUiに移行
1 parent bd7142b commit 860e9f9

File tree

1 file changed

+26
-43
lines changed

1 file changed

+26
-43
lines changed

web/app/friends/page.tsx

Lines changed: 26 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,39 @@
11
"use client";
22

3-
import { Tab, Tabs } from "@mui/material";
4-
import { useState } from "react";
53
import { NavigateByAuthState } from "~/components/common/NavigateByAuthState";
64
import Matchings from "~/components/match/matching";
75
import Requests from "~/components/match/requests";
86

97
export default function Friends() {
10-
const [open, setOpen] = useState(0);
11-
12-
const handleChange = (_event: React.SyntheticEvent, newOpen: number) => {
13-
setOpen(newOpen);
14-
};
15-
168
return (
179
<NavigateByAuthState type="toLoginForUnauthenticated">
18-
<div className="fixed z-50 w-full border-gray-200 border-b-[1px] bg-white">
19-
<Tabs value={open} onChange={handleChange} variant="fullWidth">
20-
<Tab label="マッチ中" {...a11yProps(0)} sx={{ width: "50%" }} />
21-
<Tab label="リクエスト" {...a11yProps(1)} sx={{ width: "50%" }} />
22-
</Tabs>
23-
</div>
24-
<div className="absolute top-9 right-0 left-0 overflow-y-auto">
25-
<TabPanel open={open}>
26-
{open === 0 ? <Matchings /> : open === 1 ? <Requests /> : null}
27-
</TabPanel>
10+
{/* biome-ignore lint/a11y/useSemanticElements: <explanation> */}
11+
<div role="tablist" className="tabs tabs-bordered w-full">
12+
<input
13+
type="radio"
14+
name="my_tabs_1"
15+
role="tab"
16+
className="tab"
17+
aria-label="マッチ中"
18+
defaultChecked
19+
/>
20+
{/* biome-ignore lint/a11y/useSemanticElements: <explanation> */}
21+
<div role="tabpanel" className="tab-content p-10 ">
22+
<Matchings />
23+
</div>
24+
25+
<input
26+
type="radio"
27+
name="my_tabs_1"
28+
role="tab"
29+
className="tab"
30+
aria-label="リクエスト"
31+
/>
32+
{/* biome-ignore lint/a11y/useSemanticElements: <explanation> */}
33+
<div role="tabpanel" className="tab-content p-10">
34+
<Requests />
35+
</div>
2836
</div>
2937
</NavigateByAuthState>
3038
);
3139
}
32-
33-
function TabPanel({
34-
open,
35-
children,
36-
}: {
37-
open: number;
38-
children: React.ReactNode;
39-
}) {
40-
return (
41-
<div
42-
// role="tabpanel" // FIXME: biome says it should not be a div, but I couldn't find a proper html elem
43-
id={`tabpanel-${open}`}
44-
aria-labelledby={`tab-${open}`}
45-
>
46-
<div>{children}</div>
47-
</div>
48-
);
49-
}
50-
51-
function a11yProps(index: number) {
52-
return {
53-
id: `tab-${index}`,
54-
"aria-controls": `tabpanel-${index}`,
55-
};
56-
}

0 commit comments

Comments
 (0)