mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-07 08:26:15 +00:00
chore: Refactor handlePopoverChange function
This commit is contained in:
parent
5e3aa163a1
commit
e0cce43511
1 changed files with 5 additions and 9 deletions
|
|
@ -164,13 +164,6 @@ export default function ContentApp({
|
|||
}
|
||||
};
|
||||
|
||||
async function handlePopoverChange() {
|
||||
setIsPopoverOpen(!isPopoverOpen);
|
||||
if (isPopoverOpen) {
|
||||
await getSpaces();
|
||||
}
|
||||
}
|
||||
|
||||
async function sendUrlToAPI(spaces: string[]) {
|
||||
setLoading(true);
|
||||
|
||||
|
|
@ -248,10 +241,13 @@ export default function ContentApp({
|
|||
<div className="flex justify-end items-end min-h-screen h-full w-full">
|
||||
<Toaster />
|
||||
|
||||
<Popover open={isPopoverOpen} onOpenChange={handlePopoverChange}>
|
||||
<Popover
|
||||
open={isPopoverOpen}
|
||||
onOpenChange={() => setIsPopoverOpen(!isPopoverOpen)}
|
||||
>
|
||||
<TooltipProvider>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<TooltipTrigger onClick={async () => await getSpaces()} asChild>
|
||||
<PopoverTrigger
|
||||
className={`${hover || isPopoverOpen ? "opacity-100" : "opacity-75 pointer-events-none translate-x-3/4"} focus-within:translate-x-0 focus-visible:translate-x-0 size-12 hover:bg-black p-2 rounded-l-2xl transition bg-secondary border-2 border-border opacity-0 absolute flex bottom-20 items-center text-lg`}
|
||||
>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue