Skip to content

Commit

Permalink
Merge pull request #39 from sweatpotato13/develop
Browse files Browse the repository at this point in the history
Add nickname filter in horn page
  • Loading branch information
sweatpotato13 authored Dec 18, 2024
2 parents 67f4a02 + a717ae2 commit 058d287
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 33 deletions.
66 changes: 40 additions & 26 deletions src/app/horn/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default function HornPage() {

const [selectedServer, setSelectedServer] = useState(servers[0]);
const [searchTerm, setSearchTerm] = useState("");
const [searchNickname, setSearchNickname] = useState("");
const [messagesData, setMessagesData] = useState<any>([]);
const [loading, setLoading] = useState(false);
const [error, setError] = useState("");
Expand Down Expand Up @@ -115,43 +116,51 @@ export default function HornPage() {
<div className="flex flex-col items-center justify-start h-[70vh] p-6">
<div className="w-full max-w-4xl p-6 shadow-lg rounded-lg">
<h2 className="text-xl font-bold mb-4">메시지 목록</h2>
<div className="flex mb-4 items-center">
<div className="dropdown mr-2">
<div tabIndex={0} role="button" className="btn m-1">
{selectedServer}
<div className="flex mb-4 flex-col sm:flex-row gap-2 sm:gap-0">
<div className="flex items-center gap-2">
<div className="dropdown">
<div tabIndex={0} role="button" className="btn m-1">
{selectedServer}
</div>
<ul
tabIndex={0}
className="dropdown-content menu bg-base-100 rounded-box z-[1] w-52 p-2 shadow"
>
{servers.map(server => (
<li key={server}>
<a
onClick={() =>
setSelectedServer(server)
}
>
{server}
</a>
</li>
))}
</ul>
</div>
<ul
tabIndex={0}
className="dropdown-content menu bg-base-100 rounded-box z-[1] w-52 p-2 shadow"
>
{servers.map(server => (
<li key={server}>
<a
onClick={() =>
setSelectedServer(server)
}
>
{server}
</a>
</li>
))}
</ul>
</div>
<div className="ml-auto flex items-center">
<input
className="input input-bordered w-full sm:w-64"
placeholder="검색 키워드"
className="input input-bordered w-full sm:w-48"
placeholder="닉네임"
value={searchNickname}
onChange={e => setSearchNickname(e.target.value)}
/>
<input
className="input input-bordered w-full sm:w-48"
placeholder="키워드"
value={searchTerm}
onChange={e => setSearchTerm(e.target.value)}
/>
</div>
<div className="flex items-center justify-end sm:ml-auto gap-2">
<button
className="btn btn-outline ml-2"
className="btn btn-outline"
onClick={handleSearch}
>
검색
</button>
<div
className="tooltip tooltip-left ml-2"
className="tooltip tooltip-left"
data-tip="1분마다 알림 키워드가 포함된 뿔피리 메시지가 있다면 소리로 알립니다."
>
<button
Expand Down Expand Up @@ -244,6 +253,11 @@ export default function HornPage() {
.filter((message: any) =>
message.message.includes(searchTerm)
)
.filter((message: any) =>
message.character_name.includes(
searchNickname
)
)
.map((message: any, index: any) => (
<tr key={index}>
<td className="p-2">
Expand Down
4 changes: 2 additions & 2 deletions src/constant/all-items-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35995,5 +35995,5 @@ export const AllItemsName = [
"블랙 콤보 카드",
"스페셜 골드 콤보 카드 : 전투 점성술사(스타 데토네이션)",
"스페셜 골드 콤보 카드 : 전투 점성술사(스텔라 브레이크)",
"베네피크 골드 콤보 카드"
];
"베네피크 골드 콤보 카드",
];
18 changes: 13 additions & 5 deletions src/constant/changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const changelogData = [
{
description:
"경매장 아이템 검색 자동완성 업데이트일 기준 모든 아이템 반영",
}
},
],
},
{
Expand All @@ -63,7 +63,7 @@ export const changelogData = [
{
description:
"경매장 아이템 검색 자동완성 업데이트일 기준 모든 아이템 반영",
}
},
],
},
{
Expand All @@ -72,7 +72,7 @@ export const changelogData = [
{
description:
"경매장 아이템 검색 자동완성 업데이트일 기준 모든 아이템 반영",
}
},
],
},
{
Expand All @@ -81,7 +81,7 @@ export const changelogData = [
{
description:
"경매장 아이템 검색 자동완성 업데이트일 기준 모든 아이템 반영",
}
},
],
},
{
Expand All @@ -90,7 +90,15 @@ export const changelogData = [
{
description:
"경매장 아이템 검색 자동완성 업데이트일 기준 모든 아이템 반영",
}
},
],
},
{
date: "2024-12-18",
changes: [
{
description: "뿔피리 페이지 닉네임 검색 추가",
},
],
},
];

0 comments on commit 058d287

Please sign in to comment.