Merge pull request #30 from jnsturgis/main
Added x button to modal dialogs Issue #20
This commit is contained in:
commit
2de2d07fa8
3 changed files with 22 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
||||||
import { Fragment } from 'react'
|
import { Fragment } from 'react'
|
||||||
import { Dialog, Transition } from '@headlessui/react'
|
import { Dialog, Transition } from '@headlessui/react'
|
||||||
|
import { XCircleIcon } from '@heroicons/react/outline'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
isOpen: boolean
|
isOpen: boolean
|
||||||
|
@ -44,6 +45,12 @@ export const AboutModal = ({ isOpen, handleClose }: Props) => {
|
||||||
leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
||||||
>
|
>
|
||||||
<div className="inline-block align-bottom bg-white rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-sm sm:w-full sm:p-6">
|
<div className="inline-block align-bottom bg-white rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-sm sm:w-full sm:p-6">
|
||||||
|
<div className="absolute right-4 top-4">
|
||||||
|
<XCircleIcon
|
||||||
|
className="h-6 w-6 cursor-pointer"
|
||||||
|
onClick={() => handleClose()}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div className="text-center">
|
<div className="text-center">
|
||||||
<Dialog.Title
|
<Dialog.Title
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { Fragment } from 'react'
|
import { Fragment } from 'react'
|
||||||
import { Dialog, Transition } from '@headlessui/react'
|
import { Dialog, Transition } from '@headlessui/react'
|
||||||
import { Cell } from '../grid/Cell'
|
import { Cell } from '../grid/Cell'
|
||||||
|
import { XCircleIcon } from '@heroicons/react/outline'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
isOpen: boolean
|
isOpen: boolean
|
||||||
|
@ -45,6 +46,12 @@ export const InfoModal = ({ isOpen, handleClose }: Props) => {
|
||||||
leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
||||||
>
|
>
|
||||||
<div className="inline-block align-bottom bg-white rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-sm sm:w-full sm:p-6">
|
<div className="inline-block align-bottom bg-white rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-sm sm:w-full sm:p-6">
|
||||||
|
<div className="absolute right-4 top-4">
|
||||||
|
<XCircleIcon
|
||||||
|
className="h-6 w-6 cursor-pointer"
|
||||||
|
onClick={() => handleClose()}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div className="text-center">
|
<div className="text-center">
|
||||||
<Dialog.Title
|
<Dialog.Title
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { Dialog, Transition } from '@headlessui/react'
|
||||||
import { CheckIcon } from '@heroicons/react/outline'
|
import { CheckIcon } from '@heroicons/react/outline'
|
||||||
import { MiniGrid } from '../mini-grid/MiniGrid'
|
import { MiniGrid } from '../mini-grid/MiniGrid'
|
||||||
import { shareStatus } from '../../lib/share'
|
import { shareStatus } from '../../lib/share'
|
||||||
|
import { XCircleIcon } from '@heroicons/react/outline'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
isOpen: boolean
|
isOpen: boolean
|
||||||
|
@ -36,7 +37,7 @@ export const WinModal = ({
|
||||||
>
|
>
|
||||||
<Dialog.Overlay className="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" />
|
<Dialog.Overlay className="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" />
|
||||||
</Transition.Child>
|
</Transition.Child>
|
||||||
|
|
||||||
{/* This element is to trick the browser into centering the modal contents. */}
|
{/* This element is to trick the browser into centering the modal contents. */}
|
||||||
<span
|
<span
|
||||||
className="hidden sm:inline-block sm:align-middle sm:h-screen"
|
className="hidden sm:inline-block sm:align-middle sm:h-screen"
|
||||||
|
@ -54,6 +55,12 @@ export const WinModal = ({
|
||||||
leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
|
||||||
>
|
>
|
||||||
<div className="inline-block align-bottom bg-white rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-sm sm:w-full sm:p-6">
|
<div className="inline-block align-bottom bg-white rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-sm sm:w-full sm:p-6">
|
||||||
|
<div className="absolute right-4 top-4">
|
||||||
|
<XCircleIcon
|
||||||
|
className="h-6 w-6 cursor-pointer"
|
||||||
|
onClick={() => handleClose()}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div className="mx-auto flex items-center justify-center h-12 w-12 rounded-full bg-green-100">
|
<div className="mx-auto flex items-center justify-center h-12 w-12 rounded-full bg-green-100">
|
||||||
<CheckIcon
|
<CheckIcon
|
||||||
|
|
Loading…
Add table
Reference in a new issue