Skip to content

Commit

Permalink
Added x button to modal dialogs Issue roedoejet#20
Browse files Browse the repository at this point in the history
  • Loading branch information
jnsturgis committed Jan 17, 2022
1 parent da01ac1 commit 8fc56f0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/components/modals/AboutModal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Fragment } from 'react'
import { Dialog, Transition } from '@headlessui/react'
import { XCircleIcon } from '@heroicons/react/outline'

type Props = {
isOpen: boolean
Expand Down Expand Up @@ -44,6 +45,12 @@ export const AboutModal = ({ isOpen, handleClose }: Props) => {
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="absolute right-4 top-4">
<XCircleIcon
className="h-6 w-6 cursor-pointer"
onClick={() => handleClose()}
/>
</div>
<div>
<div className="text-center">
<Dialog.Title
Expand Down
7 changes: 7 additions & 0 deletions src/components/modals/InfoModal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Fragment } from 'react'
import { Dialog, Transition } from '@headlessui/react'
import { Cell } from '../grid/Cell'
import { XCircleIcon } from '@heroicons/react/outline'

type Props = {
isOpen: boolean
Expand Down Expand Up @@ -45,6 +46,12 @@ export const InfoModal = ({ isOpen, handleClose }: Props) => {
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="absolute right-4 top-4">
<XCircleIcon
className="h-6 w-6 cursor-pointer"
onClick={() => handleClose()}
/>
</div>
<div>
<div className="text-center">
<Dialog.Title
Expand Down
9 changes: 8 additions & 1 deletion src/components/modals/WinModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Dialog, Transition } from '@headlessui/react'
import { CheckIcon } from '@heroicons/react/outline'
import { MiniGrid } from '../mini-grid/MiniGrid'
import { shareStatus } from '../../lib/share'
import { XCircleIcon } from '@heroicons/react/outline'

type Props = {
isOpen: boolean
Expand Down Expand Up @@ -36,7 +37,7 @@ export const WinModal = ({
>
<Dialog.Overlay className="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" />
</Transition.Child>

{/* This element is to trick the browser into centering the modal contents. */}
<span
className="hidden sm:inline-block sm:align-middle sm:h-screen"
Expand All @@ -54,6 +55,12 @@ export const WinModal = ({
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="absolute right-4 top-4">
<XCircleIcon
className="h-6 w-6 cursor-pointer"
onClick={() => handleClose()}
/>
</div>
<div>
<div className="mx-auto flex items-center justify-center h-12 w-12 rounded-full bg-green-100">
<CheckIcon
Expand Down

0 comments on commit 8fc56f0

Please sign in to comment.