Implement deletion + context menu
This commit is contained in:
parent
7b23283201
commit
49a558589c
6 changed files with 169 additions and 1 deletions
23
src/Components/Menu/Menu.tsx
Normal file
23
src/Components/Menu/Menu.tsx
Normal file
|
@ -0,0 +1,23 @@
|
|||
import * as React from 'react';
|
||||
|
||||
interface IMenuProps {
|
||||
className?: string
|
||||
x: number
|
||||
y: number
|
||||
isOpen: boolean
|
||||
children: React.ReactNode[] | React.ReactNode
|
||||
}
|
||||
|
||||
export const Menu: React.FC<IMenuProps> = (props) => {
|
||||
const visible = props.isOpen ? 'visible opacity-1' : 'invisible opacity-0';
|
||||
return (
|
||||
<div
|
||||
className={`fixed ${props.className ?? ''} ${visible}`}
|
||||
style={{
|
||||
left: props.x,
|
||||
top: props.y
|
||||
}}>
|
||||
{ props.children }
|
||||
</div>
|
||||
);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue