Created
October 18, 2023 01:02
-
-
Save codigoconjuan/1d5338590a7c7857bd2a4673830a2a86 to your computer and use it in GitHub Desktop.
Componente para Notificaciones
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Fragment } from 'react' | |
import { CheckCircleIcon, XCircleIcon } from '@heroicons/react/24/outline' | |
import { XMarkIcon } from '@heroicons/react/20/solid' | |
import { Transition } from '@headlessui/react' | |
export default function Notification() { | |
const notification = {} | |
return ( | |
<div | |
aria-live="assertive" | |
className="pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6" | |
> | |
<div className="flex w-full flex-col items-center space-y-4 sm:items-end"> | |
<Transition | |
show={notification.show} | |
as={Fragment} | |
enter="transform ease-out duration-300 transition" | |
enterFrom="translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2" | |
enterTo="translate-y-0 opacity-100 sm:translate-x-0" | |
leave="transition ease-in duration-100" | |
leaveFrom="opacity-100" | |
leaveTo="opacity-0" | |
> | |
<div className="pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5"> | |
<div className="p-4"> | |
<div className="flex items-start"> | |
<div className="flex-shrink-0"> | |
</div> | |
<div className="ml-3 w-0 flex-1 pt-0.5"> | |
<p className="text-sm font-medium text-gray-900">Notificación</p> | |
<p className="mt-1 text-sm text-gray-500"></p> | |
</div> | |
<div className="ml-4 flex flex-shrink-0"> | |
<button | |
type="button" | |
className="inline-flex rounded-md bg-white text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2" | |
onClick={() => { }} | |
> | |
<span className="sr-only">Cerrar</span> | |
<XMarkIcon className="h-5 w-5" aria-hidden="true" /> | |
</button> | |
</div> | |
</div> | |
</div> | |
</div> | |
</Transition> | |
</div> | |
</div> | |
) | |
} |
Gracias.
uwu arigato gozaimasu :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
gracias