Cleanup codebase

This commit is contained in:
Ariful Alam
2022-07-18 13:12:10 +06:00
parent 66bd370f34
commit dbdabc7b4a
7 changed files with 18 additions and 30 deletions

View File

@@ -7,13 +7,7 @@ import { getDevPost, getMediumPost } from '@arifszn/blog-js';
import { formatDistance } from 'date-fns';
const displaySection = (blog) => {
if (
typeof blog !== 'undefined' &&
typeof blog.source !== 'undefined' &&
typeof blog.username !== 'undefined' &&
blog.source &&
blog.username
) {
if (blog?.source && blog?.username) {
return true;
} else {
return false;
@@ -121,8 +115,7 @@ const Blog = ({ loading, blog, googleAnalytics }) => {
console.error(error);
}
typeof window !== 'undefined' &&
window.open(article.link, '_blank');
window?.open(article.link, '_blank');
}}
>
<div className="p-8 h-full w-full">