Skip to content

Commit

Permalink
Merge pull request #445 from MeetDOD/issue-439
Browse files Browse the repository at this point in the history
Feat: Added link to table and card in admin dashboard successfully issue 439
  • Loading branch information
Ultimateutkarsh11 authored Jul 15, 2024
2 parents 66ec6fa + 3a31a54 commit 7fc257b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions admin/src/components/NewPosts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useEffect, useState } from "react";
import { IPost } from '../types';
import { useRecoilValue } from "recoil";
import { tokenState } from "../store/atoms/auth";
import { Link } from "react-router-dom";

const NewPosts = () => {
const [posts, setposts] = useState<IPost[]>([]);
Expand Down Expand Up @@ -61,9 +62,9 @@ const NewPosts = () => {
<td className="px-14 py-4 font-semibold">{posts.comments.length}</td>
<td className="px-12 py-4 font-semibold">{posts.reactions.length}</td>
<td className="px-2 py-4">
<button className='font-semibold rounded-md p-2 bg-sky-500 text-white px-4 hover:bg-sky-600'>
<Link to="/admin/posts" className="font-semibold rounded-md p-2 bg-sky-500 text-white px-6 border-2 hover:bg-sky-600">
Manage
</button>
</Link>
</td>
</tr>
))}
Expand Down
2 changes: 1 addition & 1 deletion admin/src/components/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ const SideBar = ({ sidebarOpen, toggleSidebar }: { sidebarOpen: boolean, toggleS
<Link to="/admin/profile" className={linkClasses('/admin/profile')}><CgProfile size={23} className='mr-3'/>My Profile</Link>
<Link to="/admin/users" className={linkClasses('/admin/users')}><HiOutlineUsers size={23} className='mr-3'/>All Users</Link>
<Link to="/admin/posts" className={linkClasses('/admin/posts')}><IoNewspaperOutline size={23} className='mr-3'/>All Posts</Link>
<Link to="/admin/statistics" className={linkClasses('/admin/statistics')}><VscGraphScatter size={23} className='mr-3'/>Statistics</Link>
<Link to="/admin/contactmessages" className={linkClasses('/admin/contactmessages')}><MdOutlineAttachEmail size={23} className='mr-3'/>Messages</Link>
<Link to="/admin/statistics" className={linkClasses('/admin/statistics')}><VscGraphScatter size={23} className='mr-3'/>Statistics</Link>
</nav>
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions admin/src/components/StatusCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const StatusCard = () => {
</div>
</div>
</div>
<div className="col-span-1">
<Link to={"/admin/contactmessages"} className="col-span-1">
<div className="flex items-center justify-between border-2 bg-[#000435] backdrop-blur-sm transition-transform duration-300 hover:-translate-y-1 px-4 py-6 rounded-xl">
<div className='inline-block p-2 text-white bg-sky-500 rounded-xl'>
<SiGooglemessages size={40} />
Expand All @@ -93,7 +93,7 @@ const StatusCard = () => {
<p className="text-gray-200 py-1">Contact Messages</p>
</div>
</div>
</div>
</Link>
<div className="col-span-1">
<div className="hover:cursor-default flex items-center justify-between border-2 bg-[#000435] backdrop-blur-sm cursor-pointer transition-transform duration-300 hover:-translate-y-1 px-4 py-6 rounded-xl">
<div className='inline-block p-2 text-white bg-sky-500 rounded-xl'>
Expand Down
5 changes: 3 additions & 2 deletions admin/src/components/TrendingPosts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { MdAutoGraph } from "react-icons/md";
import { IPost } from '../types';
import { tokenState } from "../store/atoms/auth";
import { useRecoilValue } from "recoil";
import { Link } from "react-router-dom";

const TrendingPosts = () => {
const [trendingPosts, setTrendingPosts] = useState<IPost[]>([]);
Expand Down Expand Up @@ -62,9 +63,9 @@ const TrendingPosts = () => {
<td className="px-14 py-4 font-semibold">{post.comments.length}</td>
<td className="px-12 py-4 font-semibold">{post.reactions.length}</td>
<td className="px-2 py-4">
<button className='font-semibold rounded-md p-2 bg-sky-500 text-white px-4 hover:bg-sky-600'>
<Link to="/admin/posts" className="font-semibold rounded-md p-2 bg-sky-500 text-white px-6 border-2 hover:bg-sky-600">
Manage
</button>
</Link>
</td>
</tr>
))}
Expand Down

0 comments on commit 7fc257b

Please sign in to comment.