fix: empty state comic button responsiveness (#5401)
This commit is contained in:
parent
5fc99c9ce5
commit
c100c0bd85
1 changed files with 28 additions and 26 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { Ref, useState } from "react";
|
import { Fragment, Ref, useState } from "react";
|
||||||
import { usePopper } from "react-popper";
|
import { usePopper } from "react-popper";
|
||||||
import { Popover } from "@headlessui/react";
|
import { Popover } from "@headlessui/react";
|
||||||
// popper
|
// popper
|
||||||
|
|
@ -43,33 +43,35 @@ export const ComicBoxButton: React.FC<Props> = (props) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Popover>
|
<Popover as="div" className="relative">
|
||||||
<Popover.Button ref={setReferenceElement} onClick={onClick} disabled={disabled}>
|
<Popover.Button as={Fragment}>
|
||||||
<div className={`flex items-center gap-2.5 ${getButtonStyling("primary", "lg", disabled)}`}>
|
<button type="button" ref={setReferenceElement} onClick={onClick} disabled={disabled}>
|
||||||
{icon}
|
<div className={`flex items-center gap-2.5 ${getButtonStyling("primary", "lg", disabled)}`}>
|
||||||
<span className="leading-4">{label}</span>
|
{icon}
|
||||||
<span className="relative h-2 w-2">
|
<span className="leading-4">{label}</span>
|
||||||
<div
|
<span className="relative h-2 w-2">
|
||||||
onMouseEnter={handleMouseEnter}
|
<div
|
||||||
onMouseLeave={handleMouseLeave}
|
onMouseEnter={handleMouseEnter}
|
||||||
className={`absolute bg-blue-300 right-0 z-10 h-2.5 w-2.5 animate-ping rounded-full`}
|
onMouseLeave={handleMouseLeave}
|
||||||
/>
|
className={`absolute bg-blue-300 right-0 z-10 h-2.5 w-2.5 animate-ping rounded-full`}
|
||||||
<div className={`absolute bg-blue-400/40 right-0 h-1.5 w-1.5 mt-0.5 mr-0.5 rounded-full`} />
|
/>
|
||||||
</span>
|
<div className={`absolute bg-blue-400/40 right-0 h-1.5 w-1.5 mt-0.5 mr-0.5 rounded-full`} />
|
||||||
</div>
|
</span>
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
</Popover.Button>
|
</Popover.Button>
|
||||||
{isHovered && (
|
{isHovered && (
|
||||||
<Popover.Panel
|
<Popover.Panel className="fixed z-10" static>
|
||||||
as="div"
|
<div
|
||||||
className="flex flex-col rounded border border-custom-border-200 bg-custom-background-100 p-5 relative min-w-80"
|
className="flex flex-col rounded border border-custom-border-200 bg-custom-background-100 p-5 relative w-52 lg:w-60 xl:w-80"
|
||||||
ref={setPopperElement as Ref<HTMLDivElement>}
|
ref={setPopperElement as Ref<HTMLDivElement>}
|
||||||
style={styles.popper}
|
style={styles.popper}
|
||||||
{...attributes.popper}
|
{...attributes.popper}
|
||||||
static
|
>
|
||||||
>
|
<div className="absolute w-2 h-2 bg-custom-background-100 border rounded-lb-sm border-custom-border-200 border-r-0 border-t-0 transform rotate-45 bottom-2 -left-[5px]" />
|
||||||
<div className="absolute w-2 h-2 bg-custom-background-100 border rounded-lb-sm border-custom-border-200 border-r-0 border-t-0 transform rotate-45 bottom-2 -left-[5px]" />
|
<h3 className="text-lg font-semibold w-full">{title}</h3>
|
||||||
<h3 className="text-lg font-semibold w-full">{title}</h3>
|
<h4 className="mt-1 text-sm">{description}</h4>
|
||||||
<h4 className="mt-1 text-sm">{description}</h4>
|
</div>
|
||||||
</Popover.Panel>
|
</Popover.Panel>
|
||||||
)}
|
)}
|
||||||
</Popover>
|
</Popover>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue