-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
119 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
'use client' | ||
|
||
import { Dialog, Transition } from '@headlessui/react' | ||
import React, { Fragment } from 'react' | ||
import { ClipLoader } from 'react-spinners' | ||
|
||
const LoadingModal = () => { | ||
return ( | ||
<Transition.Root show as={Fragment}> | ||
<Dialog as="div" className="relative z-50" 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-gray-100 bg-opacity-50 transition-opacity" /> | ||
</Transition.Child> | ||
|
||
<div className="fixed inset-0 z-10 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 translate-y-4 sm:translate-y-0 sm:scale-95" | ||
enterTo="opacity-100 translate-y-0 sm:scale-100" | ||
leave="ease-in duration-200" | ||
leaveFrom="opacity-100 translate-y-0 sm:scale-100" | ||
leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95" | ||
> | ||
<Dialog.Panel> | ||
<ClipLoader size={40} color="#0284c7" /> | ||
</Dialog.Panel> | ||
</Transition.Child> | ||
</div> | ||
</div> | ||
</Dialog> | ||
</Transition.Root> | ||
) | ||
} | ||
|
||
export default LoadingModal |
25 changes: 25 additions & 0 deletions
25
app/conversations/[conversationId]/components/ImageModel.tsx
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
'use client' | ||
|
||
import Modal from '@/app/components/Modal' | ||
import Image from 'next/image' | ||
|
||
interface ImageModalProps { | ||
src?: string | null | ||
isOpen?: boolean | ||
onClose: () => void | ||
} | ||
|
||
const ImageModal: React.FC<ImageModalProps> = ({ isOpen, onClose, src }) => { | ||
if (!src) { | ||
return null | ||
} | ||
return ( | ||
<Modal isOpen={isOpen} onClose={onClose}> | ||
<div className="w-80 h-80"> | ||
<Image alt="Image" className="object-cover" fill src={src} /> | ||
</div> | ||
</Modal> | ||
) | ||
} | ||
|
||
export default ImageModal |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import LoadingModal from '../components/LoadingModal' | ||
|
||
const Loading = () => { | ||
return <LoadingModal /> | ||
} | ||
|
||
export default Loading |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import LoadingModal from '../components/LoadingModal' | ||
|
||
const Loading = () => { | ||
return <LoadingModal /> | ||
} | ||
|
||
export default Loading |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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