Fixed stash heart not highlighted in search results.
This commit is contained in:
@@ -1,5 +1,22 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<form
|
||||
class="search-container"
|
||||
@submit.prevent="search"
|
||||
>
|
||||
<input
|
||||
v-model="query"
|
||||
type="search"
|
||||
placeholder="Search channel"
|
||||
class="search input"
|
||||
>
|
||||
|
||||
<Icon
|
||||
icon="search"
|
||||
@click="search"
|
||||
/>
|
||||
</form>
|
||||
|
||||
<div
|
||||
v-for="(section, index) in sections"
|
||||
:key="`section-${index}`"
|
||||
@@ -32,7 +49,10 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { inject } from 'vue';
|
||||
import { ref, inject } from 'vue';
|
||||
|
||||
import { get } from '#/src/api.js';
|
||||
import navigate from '#/src/navigate.js';
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
|
||||
@@ -84,14 +104,42 @@ const sections = [
|
||||
networks,
|
||||
},
|
||||
];
|
||||
|
||||
const query = ref(pageContext.urlParsed.search.q || null);
|
||||
|
||||
async function search() {
|
||||
await get('/entities', { query: query.value });
|
||||
navigate('/channels', { q: query.value });
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.search-container {
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
padding: 1rem 1rem 0 1rem;
|
||||
|
||||
.icon {
|
||||
padding: 0 1rem;
|
||||
height: auto;
|
||||
fill: var(--shadow);
|
||||
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
fill: var(--primary);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.search {
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
.networks {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
|
||||
gap: .5rem;
|
||||
padding: .5rem;
|
||||
padding: .5rem 1rem;
|
||||
}
|
||||
|
||||
.section-label {
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
>
|
||||
by
|
||||
<Link
|
||||
:href="`/${scene.network.type}/thumbs/${scene.network.slug}`"
|
||||
:href="`/${scene.network.type}/${scene.network.slug}`"
|
||||
class="network-link entity-link"
|
||||
>
|
||||
<img
|
||||
|
||||
@@ -10,7 +10,7 @@ export async function onBeforeRender(pageContext) {
|
||||
}), {
|
||||
page: Number(pageContext.routeParams.page) || 1,
|
||||
limit: Number(pageContext.urlParsed.search.limit) || 30,
|
||||
});
|
||||
}, pageContext.user);
|
||||
|
||||
const {
|
||||
scenes,
|
||||
|
||||
Reference in New Issue
Block a user