Show admin password top banner (#6226)

* Invalid-admin fake role

* Reset password link + shell
This commit is contained in:
sean-brydon authored and GitHub committed 2023-01-01 11:19:58 +00:00
1 parent 518a4484d6
commit 6548f01efa
5 files changed
+35 -3

No files matched your search

@@ -0,0 +1,28 @@
import { useSession } from "next-auth/react";
import Link from "next/link";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { TopBanner } from "@calcom/ui";
function AdminPasswordBanner() {
const { t } = useLocale();
const { data } = useSession();
if (data?.user.role !== "INACTIVE_ADMIN") return null;
return (
<>
<TopBanner
text={t("invalid_admin_password", { user: data.user.username })}
variant="warning"
actions={
<Link href="/settings/security/password">
<a className="border-b border-b-black">{t("change_password_admin")}</a>
</Link>
}
/>
</>
);
}
export default AdminPasswordBanner;