-
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
1 parent
3504301
commit f274394
Showing
7 changed files
with
103 additions
and
138 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
22 changes: 0 additions & 22 deletions
22
apps/frontend/app/components/flows/ViewExperiment/ChartContent.tsx
This file was deleted.
Oops, something went wrong.
48 changes: 48 additions & 0 deletions
48
apps/frontend/app/components/flows/ViewExperiment/ChartModal.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,48 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { ArrowsPointingOutIcon, ArrowsPointingInIcon, XMarkIcon } from '@heroicons/react/24/outline' | ||
|
||
interface ModalProps { | ||
onClose?: () => void; | ||
fullScreen?: boolean; | ||
toggleFullscreen?: () => void; | ||
children: React.ReactNode; | ||
} | ||
|
||
const GraphModal: React.FC<ModalProps> = ({ onClose, fullScreen, toggleFullscreen, children }) => { | ||
return ReactDOM.createPortal( | ||
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50"> | ||
<div | ||
className={fullScreen ? "bg-white rounded-lg shadow-lg w-screen h-screen" : "bg-white rounded-lg shadow-lg w-11/12 md:w-1/2 lg:w-1/3"}> | ||
<div className="flex justify-end p-2"> | ||
<button | ||
onClick={toggleFullscreen} | ||
className="flex items-center justify-center p-2 text-gray-500 transition duration-200 ease-in-out bg-gray-200 rounded-full shadow hover:bg-gray-300 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2 mx-2" | ||
aria-label="Toggle Fullscreen" | ||
> | ||
{fullScreen ? | ||
( | ||
<ArrowsPointingInIcon className="w-5 h-5" /> | ||
) : ( | ||
<ArrowsPointingOutIcon className="w-5 h-5" /> | ||
) | ||
} | ||
</button> | ||
<button | ||
onClick={onClose} | ||
className="flex items-center justify-center p-2 text-gray-500 transition duration-200 ease-in-out bg-gray-200 rounded-full shadow hover:bg-gray-300 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2" | ||
aria-label="Close" | ||
> | ||
<XMarkIcon className="w-5 h-5" /> | ||
</button> | ||
</div> | ||
<div className="p-4"> | ||
{children} | ||
</div> | ||
</div> | ||
</div>, | ||
document.body | ||
); | ||
}; | ||
|
||
export default GraphModal; |
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
31 changes: 0 additions & 31 deletions
31
apps/frontend/app/components/flows/ViewExperiment/Modal.tsx
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
apps/frontend/app/components/flows/ViewExperiment/ModalContent.tsx
This file was deleted.
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