-
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
3f18d72
commit 10adf96
Showing
2 changed files
with
35 additions
and
2 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
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,24 @@ | ||
import { Component, JSX } from "solid-js"; | ||
|
||
interface PopoverProps { | ||
visible: boolean; | ||
close: () => void; | ||
children?: JSX.Element; | ||
} | ||
|
||
const Popover: Component<PopoverProps> = (props: PopoverProps) => { | ||
const visible = () => props.visible; | ||
|
||
return ( | ||
<div class={`${!visible() && "hidden"} absolute left-0 top-0 w-[100vw] h-[100vh] flex flex-row justify-center items-center`}> | ||
<div class="absolute bg-black opacity-50 w-full h-full left-0 top-0 z-40" onClick={props.close}> | ||
|
||
</div> | ||
<div class="rounded bg-white w-[75vw] max-w-96 h-[40vh] z-50"> | ||
{props.children} | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default Popover; |