mirror of
https://github.com/Lumither/nocturne.git
synced 2026-10-17 10:26:21 +00:00
feat(frontend) new tag filter, new landing page
This commit is contained in:
18 files changed
+256
-427
No files matched your search
@@ -2,6 +2,7 @@ import React from 'react';
|
||||
import Image from 'next/image';
|
||||
import { Chip } from '@nextui-org/react';
|
||||
import { MdCalendarMonth } from 'react-icons/md';
|
||||
import TagChip from '@/app/(pages)/blog/post/[id]/TagChip';
|
||||
|
||||
type Props = {
|
||||
title: string;
|
||||
@@ -50,7 +51,7 @@ const Headers = (post: Props) => {
|
||||
{
|
||||
post.tags.map((tag: string, key: any) => (
|
||||
<li key={ key } className={ `mx-1 mb-1` }>
|
||||
<Chip>{ tag }</Chip>
|
||||
<TagChip tag={ tag } />
|
||||
</li>
|
||||
))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
'use client';
|
||||
|
||||
import React from 'react';
|
||||
import { Chip } from '@nextui-org/react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
|
||||
const TagChip = ({ tag }: { tag: string }) => {
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
<div onClick={ () => router.push(`/blog?tags=${ tag }`) }>
|
||||
<Chip
|
||||
className={ 'hover:border-amber-400 hover:dark:border-amber-700 transition-all' }
|
||||
variant={ 'faded' }
|
||||
>{ tag }</Chip>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default TagChip;
|
||||
Reference in new issue
Block a user