Skip to content

Commit 170b7ee

Browse files
committed
my post redesigned
1 parent 1d5a704 commit 170b7ee

File tree

3 files changed

+53
-18
lines changed

3 files changed

+53
-18
lines changed

src/Pages/Dashboard/Posts/MyPost.js

Lines changed: 52 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -74,23 +74,60 @@ const MyPost = ({ myPost, index }) => {
7474
</th> */}
7575
<th>{index + 1}</th>
7676
<td>
77-
<div className="flex items-center space-x-3">
78-
<div className="avatar">
79-
<div className="mask mask-squircle w-12 h-12">
80-
<img src={postAuthorImg} alt="Avatar Tailwind CSS Component" />
77+
<article>
78+
<div class="flex items-start p-6">
79+
<a href="" class="block shrink-0">
80+
<img
81+
src="https://images.unsplash.com/photo-1570295999919-56ceb5ecca61?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8NHx8YXZhdGFyfGVufDB8fDB8fA%3D%3D&auto=format&fit=crop&w=800&q=60"
82+
alt="User Avatar"
83+
class="object-cover rounded-lg h-14 w-14"
84+
/>
85+
</a>
86+
87+
<div class="ml-4">
88+
<strong class="font-medium sm:text-lg">
89+
<a href="" class="hover:underline"> {postName} </a>
90+
</strong>
91+
92+
<p class="text-sm text-gray-700 line-clamp-2">
93+
{postDescription?.length > 150 ? postDescription.substring(0, 120) + '...' : postDescription}
94+
</p>
95+
96+
<div class="mt-2 sm:flex sm:items-center sm:gap-2">
97+
<div class="flex items-center text-gray-500">
98+
<svg
99+
xmlns="http://www.w3.org/2000/svg"
100+
class="w-4 h-4"
101+
fill="none"
102+
viewBox="0 0 24 24"
103+
stroke="currentColor"
104+
stroke-width="2"
105+
>
106+
<path
107+
stroke-linecap="round"
108+
stroke-linejoin="round"
109+
d="M17 8h2a2 2 0 012 2v6a2 2 0 01-2 2h-2v4l-4-4H9a1.994 1.994 0 01-1.414-.586m0 0L11 14h4a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2v4l.586-.586z"
110+
/>
111+
</svg>
112+
<p class="ml-1 text-xs">{postCategory}</p>
113+
</div>
114+
115+
<span class="hidden sm:block" aria-hidden="true">&middot;</span>
116+
117+
<p class="hidden sm:block sm:text-xs sm:text-gray-500">
118+
Author: {postAuthor?.split('@')[0]}
119+
</p>
120+
121+
<span class="hidden sm:block" aria-hidden="true">&middot;</span>
122+
123+
<p class="hidden sm:block sm:text-xs sm:text-gray-500">
124+
{postDateTime?.slice(0, 10)}
125+
</p>
126+
127+
</div>
81128
</div>
82129
</div>
83-
<div className='w-74'>
84-
<h3 className="font-bold">{postName?.slice(0, 32) + '...'}</h3>
85-
<p className="text-sm opacity-50">{postDescription?.length > 60 ? postDescription?.slice(0, 60) : postDescription}</p>
86-
<div class="badge badge-primary badge-sm">{postCategory}</div>
87-
</div>
88-
</div>
89-
</td>
90-
<td>
91-
<small>{postAuthor}</small>
92-
<br />
93-
<span className="text-xs opacity-50">{postDateTime?.slice(0, 10)}</span>
130+
</article>
94131
</td>
95132
<td>
96133
<div className="flex items-center">

src/Pages/Dashboard/Posts/MyPosts.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ const MyPosts = () => {
3535
<tr>
3636
<th>Serial</th>
3737
<th>Description</th>
38-
<th>Author</th>
3938
<th>Action</th>
4039
</tr>
4140
</thead>
@@ -51,7 +50,6 @@ const MyPosts = () => {
5150
<tr>
5251
<th>Serial</th>
5352
<th>Description</th>
54-
<th>Author</th>
5553
<th>Action</th>
5654
</tr>
5755
</tfoot>

tailwind.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ module.exports = {
2323
],
2424
},
2525
plugins: [
26-
require('daisyui', '@tailwindcss/forms')
26+
require('daisyui', '@tailwindcss/forms', '@tailwindcss/line-clamp')
2727
],
2828
}

0 commit comments

Comments
 (0)