Skip to content

Commit

Permalink
fix: ui improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
fluid-design-io committed Oct 24, 2023
1 parent e606cf1 commit 021cf91
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions apps/web/components/toolbar/shareable-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import {
PopoverTrigger,
} from "@ui/components/ui/popover";

import DesktopPreviewToolbarIcon from "../ui/desktop-primary-toolbar-button";
import primaryToolbarMenu from "../ui/primary-toolbar-menu";
import { useEffect, useState } from "react";
import { useColorStore } from "@/store/store";
import { colorHelper } from "@/lib/colorHelper";
import dynamic from "next/dynamic";
import { Skeleton } from "ui/components/ui/skeleton";
import ToolbarMenuItem from "./toolbar-menu-item";
import { AnimatePresence } from "framer-motion";

const ShareableLinkPlugin = dynamic(
() => import("@/components/toolbar/plugin/shareable-link.plugin"),
Expand Down Expand Up @@ -41,7 +41,15 @@ function ToolbarShareableLink() {
<ToolbarMenuItem {...menuItem} />
</PopoverTrigger>
<PopoverContent className="w-[18rem] sm:w-[24rem]" align="end">
{open && <ShareableLinkPlugin colors={colors} setOpen={setOpen} />}
<AnimatePresence mode="wait">
{open && (
<ShareableLinkPlugin
key={`shareable-${open}`}
colors={colors}
setOpen={setOpen}
/>
)}
</AnimatePresence>
</PopoverContent>
</Popover>
);
Expand Down

0 comments on commit 021cf91

Please sign in to comment.