Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
halituzan committed Aug 20, 2024
1 parent d08be5e commit 868cdf9
Showing 1 changed file with 76 additions and 76 deletions.
152 changes: 76 additions & 76 deletions app/Components/Main/Pages/Blog.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"use client"
"use client";
import { BlogPost, TagProps } from "@/app/Configs/types";
import { Icon } from "@iconify/react/dist/iconify.js";
import moment from "moment";
Expand All @@ -18,86 +18,86 @@ const Blog = ({ data, title, isTagPage }: Props) => {
const { tag } = router.query;

return (
<Suspense fallback={<Loading />}>
<section className='w-full p-5 h-[calc(100vh-107px)] overflow-auto'>
<h1 className='text-3xl font-semibold w-full pb-1'>{title}</h1>
{isTagPage && (
// <Suspense fallback={<Loading />}>
<section className='w-full p-5 h-[calc(100vh-107px)] overflow-auto'>
<h1 className='text-3xl font-semibold w-full pb-1'>{title}</h1>
{isTagPage && (
<div>
<Link
href={"/blogs"}
className='flex items-center cursor-pointer w-[100px] mb-5'
>
<Icon
icon='solar:map-arrow-left-bold-duotone'
className='text-orange-500'
fontSize={28}
/>
<span className='text-lg font-bod ml-1 font-bold hover:text-orange-600 hover:underline '>
Tümü
</span>
</Link>
<div>
<Link
href={"/blogs"}
className='flex items-center cursor-pointer w-[100px] mb-5'
>
<Icon
icon='solar:map-arrow-left-bold-duotone'
className='text-orange-500'
fontSize={28}
/>
<span className='text-lg font-bod ml-1 font-bold hover:text-orange-600 hover:underline '>
Tümü
</span>
</Link>
<div>
<span className='font-bold'>{tag}</span> etiketi ile{" "}
<span className='font-bold'>({data.length})</span> adet içerik
bulundu
</div>
<span className='font-bold'>{tag}</span> etiketi ile{" "}
<span className='font-bold'>({data.length})</span> adet içerik
bulundu
</div>
)}
</div>
)}

{data.map((item) => {
return (
<article key={item._id} className='my-6'>
<Link href={`/blogs/${item.url + "-" + item.code}`}>
<h3
className={`text-xl mb-1 cursor-pointer font-bold text-orange-500 hover:text-orange-600`}
>
{item.title}
</h3>
</Link>
<div className='flex items-center border-y py-1 border-y-slate-400'>
<div className='flex justify-start items-center mr-4'>
<Icon
icon={"fluent:calendar-ltr-12-regular"}
className='mr-2'
/>
<p className='italic text-sm' role='date'>
{moment(item.releaseDate).format("MMMM DD [,] YYYY")}
</p>
</div>
<div className='flex justify-start items-center mr-4'>
<Icon icon={"fluent:pen-16-regular"} className='mr-2' />
<p className='italic text-sm' role='author'>
{item.author}
</p>
</div>
<div className='flex justify-start items-center mr-2'>
<p className='text-sm flex items-center' role='author'>
{item.tags.map((i: TagProps) => {
return (
<Link
href={"/tags/" + i.url}
key={i._id}
className='mr-1 font-semibold cursor-pointer text-sm hover:underline hover:text-orange-500 flex items-center'
>
<Icon
icon={"line-md:hash-small"}
className='text-orange-500'
/>
{i.name}
</Link>
);
})}
</p>
</div>
{data.map((item) => {
return (
<article key={item._id} className='my-6'>
<Link href={`/blogs/${item.url + "-" + item.code}`}>
<h3
className={`text-xl mb-1 cursor-pointer font-bold text-orange-500 hover:text-orange-600`}
>
{item.title}
</h3>
</Link>
<div className='flex items-center border-y py-1 border-y-slate-400'>
<div className='flex justify-start items-center mr-4'>
<Icon
icon={"fluent:calendar-ltr-12-regular"}
className='mr-2'
/>
<p className='italic text-sm' role='date'>
{moment(item.releaseDate).format("MMMM DD [,] YYYY")}
</p>
</div>
<div className='mt-2 text-sm font-medium'>
<p>{item.summary}</p>
<div className='flex justify-start items-center mr-4'>
<Icon icon={"fluent:pen-16-regular"} className='mr-2' />
<p className='italic text-sm' role='author'>
{item.author}
</p>
</div>
</article>
);
})}
</section>
</Suspense>
<div className='flex justify-start items-center mr-2'>
<p className='text-sm flex items-center' role='author'>
{item.tags.map((i: TagProps) => {
return (
<Link
href={"/tags/" + i.url}
key={i._id}
className='mr-1 font-semibold cursor-pointer text-sm hover:underline hover:text-orange-500 flex items-center'
>
<Icon
icon={"line-md:hash-small"}
className='text-orange-500'
/>
{i.name}
</Link>
);
})}
</p>
</div>
</div>
<div className='mt-2 text-sm font-medium'>
<p>{item.summary}</p>
</div>
</article>
);
})}
</section>
//</Suspense>
);
};

Expand Down

0 comments on commit 868cdf9

Please sign in to comment.