(props: {
children: React.ReactNode;
Button?: React.ReactNode;
})
| 2 | import React, { Fragment } from "react"; |
| 3 | |
| 4 | export default function Flyout(props: { |
| 5 | children: React.ReactNode; |
| 6 | Button?: React.ReactNode; |
| 7 | }) { |
| 8 | return ( |
| 9 | <Popover className={"relative"}> |
| 10 | {({ open }) => ( |
| 11 | <div> |
| 12 | <Popover.Button className="focus:outline-0 focus:ring-0"> |
| 13 | {props.Button} |
| 14 | </Popover.Button> |
| 15 | |
| 16 | <Transition |
| 17 | as={Fragment} |
| 18 | enter="transition ease-out duration-100" |
| 19 | enterFrom="opacity-0 translate-y-1" |
| 20 | enterTo="opacity-100 translate-y-0" |
| 21 | leave="transition ease-in duration-200" |
| 22 | leaveFrom="opacity-100 translate-y-0" |
| 23 | leaveTo="opacity-0 translate-y-1" |
| 24 | > |
| 25 | <Popover.Panel className="absolute left-1/2 z-10 flex w-screen max-w-min -translate-x-1/2 px-4"> |
| 26 | {props.children} |
| 27 | </Popover.Panel> |
| 28 | </Transition> |
| 29 | </div> |
| 30 | )} |
| 31 | </Popover> |
| 32 | ); |
| 33 | } |
nothing calls this directly
no outgoing calls
no test coverage detected