update iframe rules mail 3
This commit is contained in:
parent
4aaf1029da
commit
b1df9ec38e
@ -10,11 +10,16 @@ export default async function Page() {
|
||||
redirect("/signin");
|
||||
}
|
||||
|
||||
const mailUrl = process.env.NEXT_PUBLIC_IFRAME_MAIL_URL;
|
||||
if (!mailUrl) {
|
||||
console.warn("NEXT_PUBLIC_IFRAME_MAIL_URL is not defined in environment variables");
|
||||
}
|
||||
|
||||
return (
|
||||
<main className="w-full h-screen bg-[#1E1E1E]">
|
||||
<div className="w-full h-full px-4 pt-12 pb-4">
|
||||
<ResponsiveIframe
|
||||
src={process.env.NEXT_PUBLIC_IFRAME_MAIL_URL || 'https://mail.slm-lab.net'}
|
||||
src={mailUrl || 'https://mail.slm-lab.net'}
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
||||
className="relative"
|
||||
style={{
|
||||
@ -35,6 +35,15 @@ interface SidebarProps {
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
interface MenuItem {
|
||||
title: string;
|
||||
icon: any;
|
||||
href: string;
|
||||
iframe?: string;
|
||||
external?: boolean;
|
||||
requiredRole?: string;
|
||||
}
|
||||
|
||||
export function Sidebar({ isOpen, onClose }: SidebarProps) {
|
||||
const { data: session } = useSession();
|
||||
const router = useRouter();
|
||||
@ -57,7 +66,7 @@ export function Sidebar({ isOpen, onClose }: SidebarProps) {
|
||||
};
|
||||
|
||||
// Base menu items (available for everyone)
|
||||
const baseMenuItems = [
|
||||
const baseMenuItems: MenuItem[] = [
|
||||
{
|
||||
title: "Diary",
|
||||
icon: BookOpen,
|
||||
@ -71,9 +80,9 @@ export function Sidebar({ isOpen, onClose }: SidebarProps) {
|
||||
external: false,
|
||||
},
|
||||
{
|
||||
title: "Mail",
|
||||
title: "Email",
|
||||
icon: Mail,
|
||||
href: "/mail",
|
||||
href: "/email",
|
||||
iframe: process.env.NEXT_PUBLIC_IFRAME_MAIL_URL,
|
||||
},
|
||||
{
|
||||
@ -121,7 +130,7 @@ export function Sidebar({ isOpen, onClose }: SidebarProps) {
|
||||
];
|
||||
|
||||
// Role-specific menu items
|
||||
const roleSpecificItems = [
|
||||
const roleSpecificItems: MenuItem[] = [
|
||||
{
|
||||
title: "Artlab",
|
||||
icon: Palette,
|
||||
@ -159,7 +168,7 @@ export function Sidebar({ isOpen, onClose }: SidebarProps) {
|
||||
];
|
||||
|
||||
const handleNavigation = (href: string, external?: boolean) => {
|
||||
if (external) {
|
||||
if (external && href) {
|
||||
window.open(href, "_blank");
|
||||
} else {
|
||||
router.push(href);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user