Skip to content

Instantly share code, notes, and snippets.

@codigoconjuan
Last active March 10, 2025 00:25
Show Gist options
  • Save codigoconjuan/92e8a52abc8bd9ea5b81e5ad664d8ef0 to your computer and use it in GitHub Desktop.
Save codigoconjuan/92e8a52abc8bd9ea5b81e5ad664d8ef0 to your computer and use it in GitHub Desktop.
Modal para los gastos de la app
import { Fragment } from 'react'
import { PlusCircleIcon } from '@heroicons/react/24/solid'
import { Dialog, Transition } from '@headlessui/react'
export default function ExpenseModal() {
return (
<>
<div className="fixed right-5 bottom-5 flex items-center justify-center">
<button
type="button"
>
<PlusCircleIcon className='w-16 h-16 text-blue-600 rounded-full' />
</button>
</div>
<Transition appear show={false} as={Fragment}>
<Dialog as="div" className="relative z-10" onClose={() => {}}>
<Transition.Child
as={Fragment}
enter="ease-out duration-300"
enterFrom="opacity-0"
enterTo="opacity-100"
leave="ease-in duration-200"
leaveFrom="opacity-100"
leaveTo="opacity-0"
>
<div className="fixed inset-0 bg-black bg-opacity-75" />
</Transition.Child>
<div className="fixed inset-0 overflow-y-auto">
<div className="flex min-h-full items-center justify-center p-4 text-center">
<Transition.Child
as={Fragment}
enter="ease-out duration-300"
enterFrom="opacity-0 scale-95"
enterTo="opacity-100 scale-100"
leave="ease-in duration-200"
leaveFrom="opacity-100 scale-100"
leaveTo="opacity-0 scale-95"
>
<Dialog.Panel className="w-full max-w-3xl transform overflow-hidden rounded-2xl bg-white p-6 text-left align-middle shadow-xl transition-all">
</Dialog.Panel>
</Transition.Child>
</div>
</div>
</Dialog>
</Transition>
</>
)
}
@pooldeveloper
Copy link

Gracias Profe!. Es el mejor, estoy aprendiendo mucho.

@ovi-dev
Copy link

ovi-dev commented Nov 19, 2024

Muy Util

@Zmario9
Copy link

Zmario9 commented Mar 10, 2025

Muchas gracias, en verdad estoy aprendiendo mucho con este curso y lo agradezco infinitamente

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment