diff --git a/src/client/component/headline.tsx b/src/client/component/headline.tsx
index b742439..3b35eda 100644
--- a/src/client/component/headline.tsx
+++ b/src/client/component/headline.tsx
@@ -104,6 +104,7 @@ export const Headline = (prop: {
{prop.menu}
>);
+
return (
- navigate(`/search?word=${encodeURIComponent(search)}`)} />
+ navSearch(search)} />
setSearch(e.target.value)}
onKeyUp={(e) => {
if (e.key === "Enter") {
- let words = search.includes("&") ? search.split("&") : [search];
- words = words.map(w => w.trim())
- .map(w => w.includes(":") ?
- `allow_tag=${w}`
- : `word=${encodeURIComponent(w)}`);
- navigate(`/search?${words.join("&")}`);
+ navSearch(search);
}
}}
value={search}>
@@ -207,6 +203,14 @@ export const Headline = (prop: {
{prop.children}
);
+ function navSearch(search: string){
+ let words = search.includes("&") ? search.split("&") : [search];
+ words = words.map(w => w.trim())
+ .map(w => w.includes(":") ?
+ `allow_tag=${w}`
+ : `word=${encodeURIComponent(w)}`);
+ navigate(`/search?${words.join("&")}`);
+ }
};
export default Headline;
\ No newline at end of file