stubs/inertia-react-ts/app/javascript/Layouts/AuthenticatedLayout.tsx in kaze-0.8.0 vs stubs/inertia-react-ts/app/javascript/Layouts/AuthenticatedLayout.tsx in kaze-0.9.0

- old
+ new

@@ -10,12 +10,11 @@ export default function Authenticated({ user, header, children, }: PropsWithChildren<{ user: User; header?: ReactNode }>) { - const [showingNavigationDropdown, setShowingNavigationDropdown] = - useState(false) + const [showingNavigationDropdown, setShowingNavigationDropdown] = useState(false) const { pathname = '' } = typeof window !== 'undefined' ? window.location : {} return ( <div className="min-h-screen bg-gray-100"> @@ -28,14 +27,11 @@ <ApplicationLogo className="block h-9 w-auto fill-current text-red-800" /> </Link> </div> <div className="hidden space-x-8 sm:-my-px sm:ms-10 sm:flex"> - <NavLink - href={dashboard_path()} - active={pathname.match(/dashboard/) != null} - > + <NavLink href={dashboard_path()} active={pathname.match(/dashboard/) != null}> Dashboard </NavLink> </div> </div> @@ -65,53 +61,34 @@ </button> </span> </Dropdown.Trigger> <Dropdown.Content> - <Dropdown.Link href={profile_edit_path()}> - Profile - </Dropdown.Link> - <Dropdown.Link - href={logout_path()} - method="post" - as="button" - > + <Dropdown.Link href={profile_edit_path()}>Profile</Dropdown.Link> + <Dropdown.Link href={logout_path()} method="post" as="button"> Log Out </Dropdown.Link> </Dropdown.Content> </Dropdown> </div> </div> <div className="-me-2 flex items-center sm:hidden"> <button - onClick={() => - setShowingNavigationDropdown( - (previousState) => !previousState, - ) - } + onClick={() => setShowingNavigationDropdown((previousState) => !previousState)} className="inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 focus:text-gray-500 transition duration-150 ease-in-out" > - <svg - className="h-6 w-6" - stroke="currentColor" - fill="none" - viewBox="0 0 24 24" - > + <svg className="h-6 w-6" stroke="currentColor" fill="none" viewBox="0 0 24 24"> <path - className={ - !showingNavigationDropdown ? 'inline-flex' : 'hidden' - } + className={!showingNavigationDropdown ? 'inline-flex' : 'hidden'} strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M4 6h16M4 12h16M4 18h16" /> <path - className={ - showingNavigationDropdown ? 'inline-flex' : 'hidden' - } + className={showingNavigationDropdown ? 'inline-flex' : 'hidden'} strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M6 18L18 6M6 6l12 12" /> @@ -119,50 +96,35 @@ </button> </div> </div> </div> - <div - className={ - (showingNavigationDropdown ? 'block' : 'hidden') + ' sm:hidden' - } - > + <div className={(showingNavigationDropdown ? 'block' : 'hidden') + ' sm:hidden'}> <div className="pt-2 pb-3 space-y-1"> - <ResponsiveNavLink - href={dashboard_path()} - active={pathname.match(/dashboard/) != null} - > + <ResponsiveNavLink href={dashboard_path()} active={pathname.match(/dashboard/) != null}> Dashboard </ResponsiveNavLink> </div> <div className="pt-4 pb-1 border-t border-gray-200"> <div className="px-4"> - <div className="font-medium text-base text-gray-800"> - {user.name} - </div> - <div className="font-medium text-sm text-gray-500"> - {user.email} - </div> + <div className="font-medium text-base text-gray-800">{user.name}</div> + <div className="font-medium text-sm text-gray-500">{user.email}</div> </div> <div className="mt-3 space-y-1"> - <ResponsiveNavLink href={profile_edit_path()}> - Profile - </ResponsiveNavLink> + <ResponsiveNavLink href={profile_edit_path()}>Profile</ResponsiveNavLink> <ResponsiveNavLink method="post" href={logout_path()} as="button"> Log Out </ResponsiveNavLink> </div> </div> </div> </nav> {header && ( <header className="bg-white shadow"> - <div className="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8"> - {header} - </div> + <div className="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">{header}</div> </header> )} <main>{children}</main> </div>