mirror of
https://github.com/Lumither/nocturne.git
synced 2026-10-17 10:26:21 +00:00
feat(blog) pagination
This commit is contained in:
14 files changed
+219
-88
No files matched your search
@@ -23,13 +23,15 @@ const MinifyPostCard = (props: Props) => {
|
||||
<p className={ `text-tiny uppercase font-bold ${ img_url ? 'text-white/60' : 'text-black/60 dark:text-white/60' }` }>{ desc }</p>
|
||||
</CardHeader>
|
||||
{ img_url &&
|
||||
<div>
|
||||
<Image
|
||||
className={ 'object-cover object-center ' }
|
||||
src={ img_url }
|
||||
alt={ post.title }
|
||||
fill
|
||||
/>
|
||||
<div className={ 'h-full' }>
|
||||
<div className={ 'relative h-[300px] overflow-hidden' }>
|
||||
<Image
|
||||
className={ 'object-cover object-center ' }
|
||||
src={ img_url }
|
||||
alt={ post.title }
|
||||
fill
|
||||
/>
|
||||
</div>
|
||||
<CardFooter
|
||||
className="absolute transition-colors bg-zinc-300/80 dark:bg-gray-600/25 dark:backdrop-brightness-75 bottom-0 justify-between rounded-none">
|
||||
<div>
|
||||
|
||||
@@ -17,11 +17,11 @@ type Props = {
|
||||
}
|
||||
|
||||
async function PostCard(props: Props) {
|
||||
|
||||
const { code, ret } = await fetchNocturneApi(`/get_post/${ props.id }`);
|
||||
|
||||
if (code == 200) {
|
||||
|
||||
try {
|
||||
const res = await fetchNocturneApi(`/get_post/${ props.id }`);
|
||||
const ret: any = await res.json();
|
||||
return (
|
||||
<div>
|
||||
<Card className={ `max-w-full relative` }>
|
||||
@@ -85,11 +85,11 @@ async function PostCard(props: Props) {
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
} else {
|
||||
} catch (e: any) {
|
||||
return <div>
|
||||
<Card className={ `w-full` }>
|
||||
<CardBody>
|
||||
Fatal: { ret }
|
||||
Fatal: { e.toString() }
|
||||
</CardBody>
|
||||
</Card>
|
||||
</div>;
|
||||
|
||||
Reference in new issue
Block a user