Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Added link to table and card in admin dashboard successfully issue 439 #445

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading