From d6fe18106100cebc2ee27c07dc3b081c2bb3af65 Mon Sep 17 00:00:00 2001 From: Timur Ercan Date: Wed, 11 Jan 2023 19:51:22 +0100 Subject: [PATCH] design --- apps/web/components/layout.tsx | 44 +----------------------------- apps/web/components/login.tsx | 6 ++-- apps/web/components/navigation.tsx | 42 ++++++++++++++++++++++------ apps/web/components/settings.tsx | 10 +++---- apps/web/components/signup.tsx | 6 ++-- 5 files changed, 46 insertions(+), 62 deletions(-) diff --git a/apps/web/components/layout.tsx b/apps/web/components/layout.tsx index 5afff033f..8c78c91c8 100644 --- a/apps/web/components/layout.tsx +++ b/apps/web/components/layout.tsx @@ -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 ( <> diff --git a/apps/web/components/login.tsx b/apps/web/components/login.tsx index 6becbb3e6..d8748d3d2 100644 --- a/apps/web/components/login.tsx +++ b/apps/web/components/login.tsx @@ -73,7 +73,7 @@ export default function Login() { type="email" autoComplete="email" required - className="relative block w-full appearance-none rounded-none rounded-t-md border border-gray-300 px-3 py-2 text-gray-900 placeholder-gray-500 focus:z-10 focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm" + className="relative block w-full appearance-none rounded-none rounded-t-md border border-gray-300 px-3 py-2 text-gray-900 placeholder-gray-500 focus:z-10 focus:border-neon focus:outline-none focus:ring-neon sm:text-sm" placeholder="Email address" /> @@ -88,7 +88,7 @@ export default function Login() { type="password" autoComplete="current-password" required - className="relative block w-full appearance-none rounded-none rounded-b-md border border-gray-300 px-3 py-2 text-gray-900 placeholder-gray-500 focus:z-10 focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm" + className="relative block w-full appearance-none rounded-none rounded-b-md border border-gray-300 px-3 py-2 text-gray-900 placeholder-gray-500 focus:z-10 focus:border-neon focus:outline-none focus:ring-neon sm:text-sm" placeholder="Password" /> @@ -106,7 +106,7 @@ export default function Login() { diff --git a/apps/web/components/signup.tsx b/apps/web/components/signup.tsx index 8a6c4e0cf..2dacf1831 100644 --- a/apps/web/components/signup.tsx +++ b/apps/web/components/signup.tsx @@ -92,7 +92,7 @@ export default function Signup() { type="email" autoComplete="email" required - className="relative block w-full appearance-none rounded-none rounded-t-md border border-gray-300 px-3 py-2 text-gray-900 placeholder-gray-500 focus:z-10 focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm" + className="relative block w-full appearance-none rounded-none rounded-t-md border border-gray-300 px-3 py-2 text-gray-900 placeholder-gray-500 focus:z-10 focus:border-neon focus:outline-none focus:ring-neon sm:text-sm" placeholder="Email" /> @@ -107,7 +107,7 @@ export default function Signup() { type="password" autoComplete="current-password" required - className="relative block w-full appearance-none rounded-none rounded-b-md border border-gray-300 px-3 py-2 text-gray-900 placeholder-gray-500 focus:z-10 focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm" + className="relative block w-full appearance-none rounded-none rounded-b-md border border-gray-300 px-3 py-2 text-gray-900 placeholder-gray-500 focus:z-10 focus:border-neon focus:outline-none focus:ring-neon sm:text-sm" placeholder="Password" /> @@ -117,7 +117,7 @@ export default function Signup() {