Skip to content

Commit a1418aa

Browse files
committed
ユーザ検索のデザインを修正
1 parent 295ab9c commit a1418aa

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

web/app/search/page.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,9 @@ export default function SearchPage({
5555
);
5656

5757
return (
58-
<div className="flex justify-center">
59-
<div className="w-full">
60-
<h2 className="m-5 mb-4 font-bold text-2xl">ユーザー検索</h2>
61-
<Search placeholder="検索" setSearchString={setQuery} />
58+
<div className="flex h-full flex-col justify-center gap-2 p-4">
59+
<Search placeholder="検索" setSearchString={setQuery} />
60+
<div className="flex-1">
6261
{query !== "" ? (
6362
users.length > 0 ? (
6463
<Table users={users} canRequest={canRequest} />

web/components/search/search.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,17 @@ export default function Search({ placeholder, setSearchString }: Props) {
2121
}
2222

2323
return (
24-
<div className="relative mr-5 ml-5 flex flex-1 flex-shrink-0">
25-
<label htmlFor="search" className="sr-only">
26-
Search
27-
</label>
24+
<label className="input input-bordered flex items-center gap-2">
25+
<MdOutlineSearch className="text-gray-500" />
2826
<input
29-
className=" block w-full rounded-md border border-gray-200 py-[9px] pl-10 text-sm outline-none placeholder:text-gray-500 focus:border-primary focus:ring-1 focus:ring-primary"
27+
type="text"
28+
className="grow"
3029
placeholder={placeholder}
3130
onChange={(e) => {
3231
handleSearch(e.target.value);
3332
}}
3433
defaultValue={searchParams.get("query")?.toString()}
3534
/>
36-
<MdOutlineSearch className="-translate-y-1/2 absolute top-1/2 left-3 h-[18px] w-[18px] text-gray-500 peer-focus:text-gray-900" />
37-
</div>
35+
</label>
3836
);
3937
}

0 commit comments

Comments
 (0)