From 1823538058859a9c26e37538c945b0fb13e2b7c8 Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Wed, 20 Mar 2024 12:46:55 +0000 Subject: [PATCH] Added a link for admins to go to the CMS --- src/dashboards/Admin.tsx | 8 ++++++++ src/dashboards/IconCard.tsx | 5 +++-- src/pages/profile.tsx | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/dashboards/Admin.tsx b/src/dashboards/Admin.tsx index e01360b7..b0255104 100644 --- a/src/dashboards/Admin.tsx +++ b/src/dashboards/Admin.tsx @@ -16,6 +16,8 @@ import { BsPencilSquare, BsBank, BsCurrencyDollar, + BsLayoutWtf, + BsLayoutSidebar, } from "react-icons/bs"; import UserCard from "@/components/UserCard"; import useGroups from "@/hooks/useGroups"; @@ -309,6 +311,12 @@ export default function AdminDashboard({user}: Props) { value={pending.length} color="rose" /> + router.push("https://cms.encoach.com/admin")} + Icon={BsLayoutSidebar} + label="Content Management System (CMS)" + color="green" + />
diff --git a/src/dashboards/IconCard.tsx b/src/dashboards/IconCard.tsx index 4a8ae2d5..5fd55486 100644 --- a/src/dashboards/IconCard.tsx +++ b/src/dashboards/IconCard.tsx @@ -4,8 +4,8 @@ import {IconType} from "react-icons"; interface Props { Icon: IconType; label: string; - value: string | number; - color: "purple" | "rose" | "red"; + value?: string | number; + color: "purple" | "rose" | "red" | "green"; tooltip?: string; onClick?: () => void; } @@ -15,6 +15,7 @@ export default function IconCard({Icon, label, value, color, tooltip, onClick}: purple: "text-mti-purple-light", red: "text-mti-red-light", rose: "text-mti-rose-light", + green: "text-mti-green-light", }; return ( diff --git a/src/pages/profile.tsx b/src/pages/profile.tsx index 68e652d2..d2031cd1 100644 --- a/src/pages/profile.tsx +++ b/src/pages/profile.tsx @@ -41,7 +41,7 @@ export const getServerSideProps = withIronSessionSsr(({req, res}) => { redirect: { destination: "/login", permanent: false, - } + }, }; } @@ -50,7 +50,7 @@ export const getServerSideProps = withIronSessionSsr(({req, res}) => { redirect: { destination: "/", permanent: false, - } + }, }; }