Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolve thead overlay issue on scroll - issue #92 #102

Merged
merged 3 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/Tracer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ function InstructionsTable({
return (
<table className="w-full font-mono text-tiny">
<thead>
<tr className="text-left sticky top-0 bg-gray-50 dark:bg-black-600 text-gray-400 dark:text-gray-600 border-b border-gray-200 dark:border-black-500">
<tr className="sticky top-0 z-10 text-left bg-gray-50 dark:bg-black-600 text-gray-400 dark:text-gray-600 border-b border-gray-200 dark:border-black-500">
<th className="py-1"></th>
<th className="py-1"></th>
<th className="py-1"></th>
Expand Down
44 changes: 24 additions & 20 deletions components/ui/Modal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { RiCloseLine } from '@remixicon/react'
import ReactDOM from 'react-dom'

export type ModalProps = {
title: string
Expand All @@ -16,31 +17,34 @@ export const Modal = ({
const closeModal = () => setVisible(false)

return visible ? (
<div
className="flex fixed top-0 left-0 z-80 w-screen h-screen bg-gray-800/50 dark:bg-gray-800/50 justify-center items-center cursor-auto"
role="button"
tabIndex={0}
onClick={closeModal}
onKeyDown={closeModal}
>
ReactDOM.createPortal(
<div
className="md:max-w-3xl relative p-4 bg-white text-gray-900 dark:bg-gray-800 dark:text-gray-400 w-full m-auto flex-col flex rounded-lg cursor-auto"
className="flex fixed inset-0 z-50 bg-gray-800/50 dark:bg-gray-800/50 justify-center items-center cursor-auto"
role="button"
tabIndex={0}
onClick={(e) => e.stopPropagation()}
onKeyDown={(e) => e.stopPropagation()}
onClick={closeModal}
onKeyDown={closeModal}
>
<div className="flex flex-row justify-between pb-2 border-b border-slate-300 mb-4">
<h2 className="text-sm md:text-md lg:text-lg font-semibold">
{title}
</h2>
<button onClick={closeModal} aria-label="Close modal">
<RiCloseLine size={24} />
</button>
<div
className="md:max-w-3xl relative p-4 bg-white text-gray-900 dark:bg-gray-800 dark:text-gray-400 w-full m-auto flex-col flex rounded-lg cursor-auto"
role="button"
tabIndex={0}
onClick={(e) => e.stopPropagation()}
onKeyDown={(e) => e.stopPropagation()}
>
<div className="flex flex-row justify-between pb-2 border-b border-slate-300 mb-4">
<h2 className="text-sm md:text-md lg:text-lg font-semibold">
{title}
</h2>
<button onClick={closeModal} aria-label="Close modal">
<RiCloseLine size={24} />
</button>
</div>
{children}
</div>
{children}
</div>
</div>
</div>,
document.body,
)
) : (
<></>
)
Expand Down
Loading