Skip to content

Commit

Permalink
feat: display before after search info
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 committed May 8, 2023
1 parent 6ba0f12 commit 29d8c54
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion packages/app/src/pages/resources/[page].astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
import { format } from 'date-fns';
import Layout from '../../layouts/Layout.astro';
import Pagination from '../../components/Pagination.astro';
import ResourceTable from '../../components/ResourceTable.astro';
Expand Down Expand Up @@ -39,9 +41,21 @@ const resources = await fetchResources(page, {
<Layout title="所有资源 | Anime Garden">
<div class="mt-4vh w-full">
{
(include || exclude) && (
(include || exclude || before || after) && (
<>
<div class="mb4 p4 w-full bg-gray-100 rounded-md space-y-2">
{after && (
<div class="space-x-1 select-none">
<span class="text-base-800 font-bold inline-block">搜索开始于</span>
<span class="select-text">{format(after, 'yyyy 年 M 月 d 日 hh:mm')}</span>
</div>
)}
{before && (
<div class="space-x-1 select-none">
<span class="text-base-800 font-bold inline-block">搜索结束于</span>
<span class="select-text">{format(before, 'yyyy 年 M 月 d 日 hh:mm')}</span>
</div>
)}
{include && include.length > 0 && (
<div class="space-x-1 select-none">
<span class="text-base-800 font-bold inline-block">包含关键词</span>
Expand Down

0 comments on commit 29d8c54

Please sign in to comment.