BlogSidebar.js
3.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
import React from "react";
import Link from "next/link";
import Image from "next/image";
const popularPosts = [
{
title: "Being The Best-Selling Smart Phone This Year",
date: "Jan 15, 2020",
image: "/images/blog/blog1.jpg",
link: "/blog/details",
},
{
title: "Love Songs Helped Me Through Heartbreak",
date: "Jan 14, 2020",
image: "/images/blog/blog1.jpg",
link: "/blog/details",
},
{
title: "Two Fashion Designers Busy With 2020 Winter Fashion",
date: "Jan 13, 2020",
image: "/images/blog/blog1.jpg",
link: "/blog/details",
},
{
title: "Working in the Office is a Tradition For Women",
date: "Jan 12, 2020",
image: "/images/blog/blog1.jpg",
link: "/blog/details",
},
];
const categories = [
{ name: "Business", postCount: 2, link: "/blog" },
{ name: "Privacy", postCount: 5, link: "/blog" },
{ name: "Technology", postCount: 6, link: "/blog" },
{ name: "Tips", postCount: 2, link: "/blog" },
{ name: "Uncategorized", postCount: 1, link: "/blog" },
{ name: "Log in", postCount: 1, link: "/blog" },
];
const tags = [
{ name: "Advertisement", linkCount: 3, link: "/blog" },
{ name: "Business", linkCount: 3, link: "/blog" },
{ name: "Life", linkCount: 5, link: "/blog" },
{ name: "Lifestyle", linkCount: 2, link: "/blog" },
{ name: "Fashion", linkCount: 2, link: "/blog" },
{ name: "Inspiration", linkCount: 1, link: "/blog" },
{ name: "Blog", linkCount: 1, link: "/blog" },
{ name: "Ads", linkCount: 3, link: "/blog" },
];
const BlogSidebar = () => {
return (
<>
<aside className="widget-area">
<div className="widget widget_enry_posts_thumb">
<h3 className="widget-title">Popular Posts</h3>
{popularPosts.map((post, index) => (
<article key={index} className="item">
<Link href={post.link} className="thumb">
<Image
src={post.image}
layout="fill"
className="img-fluid image fullimage cover"
alt="image"
/>
</Link>
<div className="info">
<h4 className="title usmall">
<Link href={post.link}>{post.title}</Link>
</h4>
<span className="date">
<i className="ri-calendar-2-fill"></i> {post.date}
</span>
</div>
</article>
))}
</div>
<div className="widget widget_categories">
<h3 className="widget-title">Categories</h3>
<ul>
{categories.map((category, index) => (
<li key={index}>
<Link href={category.link}>
{category.name}{" "}
<span className="post-count">({category.postCount})</span>
</Link>
</li>
))}
</ul>
</div>
<div className="widget widget_tag_cloud">
<h3 className="widget-title">Tags</h3>
<div className="tagcloud">
{tags.map((tag, index) => (
<Link key={index} href={tag.link}>
{tag.name}
<span className="tag-link-count"> ({tag.linkCount})</span>
</Link>
))}
</div>
</div>
</aside>
</>
);
};
export default BlogSidebar;