mirror of
https://github.com/NohamR/gitprofile.git
synced 2026-05-25 20:00:25 +00:00
Display empty blog state
This commit is contained in:
@@ -3,6 +3,7 @@ import { Fragment, useEffect, useState } from 'react';
|
|||||||
import { ga, skeleton } from '../../helpers/utils';
|
import { ga, skeleton } from '../../helpers/utils';
|
||||||
import LazyImage from '../lazy-image';
|
import LazyImage from '../lazy-image';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import { AiOutlineContainer } from 'react-icons/ai';
|
||||||
import { getDevPost, getMediumPost } from '@arifszn/blog-js';
|
import { getDevPost, getMediumPost } from '@arifszn/blog-js';
|
||||||
|
|
||||||
const displaySection = (blog) => {
|
const displaySection = (blog) => {
|
||||||
@@ -98,8 +99,7 @@ const Blog = ({ loading, blog, googleAnalytics }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const renderArticles = () => {
|
const renderArticles = () => {
|
||||||
return (
|
return articles && articles.length ? (
|
||||||
articles &&
|
|
||||||
articles.slice(0, blog.limit).map((article, index) => (
|
articles.slice(0, blog.limit).map((article, index) => (
|
||||||
<a
|
<a
|
||||||
className="card shadow-lg compact bg-base-100 cursor-pointer"
|
className="card shadow-lg compact bg-base-100 cursor-pointer"
|
||||||
@@ -169,6 +169,11 @@ const Blog = ({ loading, blog, googleAnalytics }) => {
|
|||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
))
|
))
|
||||||
|
) : (
|
||||||
|
<div className="text-center mb-6">
|
||||||
|
<AiOutlineContainer className="mx-auto h-12 w-12 opacity-30" />
|
||||||
|
<p className="mt-1 text-sm opacity-50">No recent post</p>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user