Add sidebar entry

This commit is contained in:
Jacob Karlsson 2020-05-03 22:38:34 +02:00
parent e456c1d9c5
commit 51ae2966f1
2 changed files with 6 additions and 3 deletions

View File

@ -310,10 +310,12 @@ router
ctx.body = await searchView({ messages, query });
})
.get("/imageSearch/", async (ctx) => {
.get("/imageSearch", async (ctx) => {
const { query } = ctx.query;
const blobs = await blob.search({ query });
const blobs = query
? await blob.search({ query })
: {}
ctx.body = await imageSearchView({ blobs, query });
})

View File

@ -132,6 +132,7 @@ const template = (...elements) => {
navLink({ href: "/mentions", emoji: "💬", text: i18n.mentions }),
navLink({ href: "/inbox", emoji: "✉️", text: i18n.private }),
navLink({ href: "/search", emoji: "🔍", text: i18n.search }),
navLink({ href: "/imageSearch", emoji: "🖼️", text: "Image Search" }),
navLink({ href: "/settings", emoji: "⚙", text: i18n.settings })
)
),
@ -1092,7 +1093,7 @@ exports.imageSearchView = ({ blobs, query }) => {
h1("Image Search"),
form(
{ action: "/imageSearch", method: "get" },
label(i18n.searchLabel, searchInput),
label("Enter words to search for images labelled with them", searchInput),
button(
{
type: "submit",