aboutsummaryrefslogtreecommitdiff
path: root/pages/search.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'pages/search.tsx')
-rw-r--r--pages/search.tsx46
1 files changed, 46 insertions, 0 deletions
diff --git a/pages/search.tsx b/pages/search.tsx
new file mode 100644
index 0000000..11cfe2c
--- /dev/null
+++ b/pages/search.tsx
@@ -0,0 +1,46 @@
+import Navbar from '../components/navbar';
+import { FormEvent } from 'react';
+import { ArticleMeta } from './post/[id]';
+
+import SearchOutlinedIcon from '@material-ui/icons/SearchOutlined';
+
+function SearchBar(props: {
+ searchFunction: (event?: FormEvent<HTMLFormElement>) => void;
+}) {
+ return <div className="searchBar">
+ <form onSubmit={props.searchFunction}>
+ <input className="input" placeholder="Search for posts..." autoComplete="off"/>
+ <button className="button" onClick={() => props.searchFunction()}><SearchOutlinedIcon/></button>
+ <input type="submit" style={{ display: "none" }}/>
+ </form>
+ </div>
+}
+
+export default function SearchPage(props: {
+ posts: Array<{
+ props: {
+ meta: ArticleMeta
+ }
+ }>
+}) {
+ return <div>
+ <div className="centeredPage">
+ <div className="titleWrapper">
+ <h1>Search for posts</h1>
+ </div>
+ <div className="navAreaWrapper">
+ <div className="sticky">
+ <Navbar page="search"/>
+ </div>
+ </div>
+ <div className="contentWrapper">
+ <SearchBar searchFunction={(event?: FormEvent<HTMLFormElement>) => {
+ event?.preventDefault();
+ }}/>
+ </div>
+ </div>
+ </div>
+}
+
+// grep -Por "^\[meta\]:\s+<tags>\s+\(\K(.+)(?=\)$)" posts
+