stubs/inertia-react-ts/app/javascript/Components/Dropdown.tsx in kaze-0.8.0 vs stubs/inertia-react-ts/app/javascript/Components/Dropdown.tsx in kaze-0.9.0

- old
+ new

@@ -1,14 +1,6 @@ -import { - useState, - createContext, - useContext, - Fragment, - PropsWithChildren, - Dispatch, - SetStateAction, -} from 'react' +import { useState, createContext, useContext, Fragment, PropsWithChildren, Dispatch, SetStateAction } from 'react' import { Link, InertiaLinkProps } from '@inertiajs/react' import { Transition } from '@headlessui/react' const DropDownContext = createContext<{ open: boolean @@ -39,16 +31,11 @@ return ( <> <div onClick={toggleOpen}>{children}</div> - {open && ( - <div - className="fixed inset-0 z-40" - onClick={() => setOpen(false)} - ></div> - )} + {open && <div className="fixed inset-0 z-40" onClick={() => setOpen(false)}></div>} </> ) } const Content = ({ @@ -91,25 +78,17 @@ > <div className={`absolute z-50 mt-2 rounded-md shadow-lg ${alignmentClasses} ${widthClasses}`} onClick={() => setOpen(false)} > - <div - className={`rounded-md ring-1 ring-black ring-opacity-5 ${contentClasses}`} - > - {children} - </div> + <div className={`rounded-md ring-1 ring-black ring-opacity-5 ${contentClasses}`}>{children}</div> </div> </Transition> </> ) } -const DropdownLink = ({ - className = '', - children, - ...props -}: InertiaLinkProps) => { +const DropdownLink = ({ className = '', children, ...props }: InertiaLinkProps) => { return ( <Link {...props} className={`block w-full px-4 py-2 text-start text-sm leading-5 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none focus:bg-gray-100 dark:focus:bg-gray-800 transition duration-150 ease-in-out ${className}`} >