mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 08:13:56 +10:00
design
This commit is contained in:
@ -2,45 +2,9 @@ import { Fragment, useEffect } from "react";
|
||||
import { Disclosure, Menu, Transition } from "@headlessui/react";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/router";
|
||||
import Navigation from "./navigation";
|
||||
|
||||
import {
|
||||
Bars3Icon,
|
||||
BellIcon,
|
||||
XMarkIcon,
|
||||
ArrowLeftOnRectangleIcon,
|
||||
UserCircleIcon,
|
||||
} from "@heroicons/react/24/outline";
|
||||
import Logo from "./logo";
|
||||
import { signOut, useSession } from "next-auth/react";
|
||||
|
||||
const user = {
|
||||
name: "Timur Ercan",
|
||||
email: "timur@documenso.com",
|
||||
imageUrl:
|
||||
"https://pbs.twimg.com/profile_images/1382036502390181888/4BT30oTM_400x400.jpg",
|
||||
};
|
||||
const navigation = [
|
||||
{ name: "Dashboard", href: "/dashboard", current: false },
|
||||
{ name: "Documents", href: "/documents", current: false },
|
||||
{ name: "Settings", href: "/settings", current: true },
|
||||
];
|
||||
const userNavigation = [
|
||||
{ name: "Your Profile", href: "/settings/profile", icon: UserCircleIcon },
|
||||
{
|
||||
name: "Sign out",
|
||||
href: "",
|
||||
click: (e: any) => {
|
||||
e.preventDefault();
|
||||
signOut({ callbackUrl: "/login" });
|
||||
},
|
||||
icon: ArrowLeftOnRectangleIcon,
|
||||
},
|
||||
];
|
||||
|
||||
function classNames(...classes: any) {
|
||||
return classes.filter(Boolean).join(" ");
|
||||
}
|
||||
import Navigation from "./navigation";
|
||||
|
||||
function useRedirectToLoginIfUnauthenticated() {
|
||||
const { data: session, status } = useSession();
|
||||
@ -67,12 +31,6 @@ function useRedirectToLoginIfUnauthenticated() {
|
||||
|
||||
export default function Layout({ children }: any) {
|
||||
useRedirectToLoginIfUnauthenticated();
|
||||
const router = useRouter();
|
||||
navigation.forEach((element) => {
|
||||
element.current = router.route.startsWith("/" + element.href.split("/")[1]);
|
||||
});
|
||||
|
||||
const { status } = useSession();
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user