mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-10 22:41:17 +00:00
remove unused imports
This commit is contained in:
parent
2aea6b3130
commit
25e7e5f051
1 changed files with 33 additions and 43 deletions
|
|
@ -1,41 +1,31 @@
|
|||
import { useAutoAnimate } from '@formkit/auto-animate/react';
|
||||
import { useAutoAnimate } from "@formkit/auto-animate/react";
|
||||
import {
|
||||
MemoryWithImage,
|
||||
MemoryWithImages3,
|
||||
MemoryWithImages2,
|
||||
} from '@/assets/MemoryWithImages';
|
||||
import { type CollectedSpaces } from '../../../types/memory';
|
||||
import { InputWithIcon } from '../ui/input';
|
||||
} from "@/assets/MemoryWithImages";
|
||||
import { type CollectedSpaces } from "../../../types/memory";
|
||||
import { InputWithIcon } from "../ui/input";
|
||||
import {
|
||||
ArrowUpRight,
|
||||
Edit3,
|
||||
MoreHorizontal,
|
||||
Search,
|
||||
Trash2,
|
||||
} from 'lucide-react';
|
||||
} from "lucide-react";
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuTrigger,
|
||||
} from '../ui/dropdown-menu';
|
||||
import {
|
||||
animate,
|
||||
AnimatePresence,
|
||||
LayoutGroup,
|
||||
motion,
|
||||
useAnimate,
|
||||
Variant,
|
||||
} from 'framer-motion';
|
||||
import { useRef, useState } from 'react';
|
||||
|
||||
} from "../ui/dropdown-menu";
|
||||
import { useState } from "react";
|
||||
import { Variant, useAnimate, motion } from "framer-motion";
|
||||
|
||||
export function MemoriesBar({ spaces }: { spaces: CollectedSpaces[] }) {
|
||||
const [parent, enableAnimations] = useAutoAnimate();
|
||||
const [currentSpaces, setCurrentSpaces] = useState(spaces);
|
||||
|
||||
console.log('currentSpaces: ', currentSpaces);
|
||||
|
||||
return (
|
||||
<div className="text-rgray-11 flex w-full flex-col items-start py-8 text-left">
|
||||
<div className="w-full px-8">
|
||||
|
|
@ -67,8 +57,8 @@ export function MemoriesBar({ spaces }: { spaces: CollectedSpaces[] }) {
|
|||
const SpaceExitVariant: Variant = {
|
||||
opacity: 0,
|
||||
scale: 0,
|
||||
borderRadius: '50%',
|
||||
background: 'var(--gray-1)',
|
||||
borderRadius: "50%",
|
||||
background: "var(--gray-1)",
|
||||
transition: {
|
||||
duration: 0.2,
|
||||
},
|
||||
|
|
@ -94,22 +84,22 @@ export function SpaceItem({
|
|||
<SpaceMoreButton
|
||||
onDelete={() => {
|
||||
if (!itemRef.current) return;
|
||||
const trash = document.querySelector('#trash')! as HTMLDivElement;
|
||||
const trashBin = document.querySelector('#trash-button')!;
|
||||
const trash = document.querySelector("#trash")! as HTMLDivElement;
|
||||
const trashBin = document.querySelector("#trash-button")!;
|
||||
const trashRect = trashBin.getBoundingClientRect();
|
||||
const scopeRect = itemRef.current.getBoundingClientRect();
|
||||
const el = document.createElement('div');
|
||||
el.style.position = 'fixed';
|
||||
el.style.top = '0';
|
||||
el.style.left = '0';
|
||||
el.style.width = '15px';
|
||||
el.style.height = '15px';
|
||||
el.style.backgroundColor = 'var(--gray-7)';
|
||||
el.style.zIndex = '60';
|
||||
el.style.borderRadius = '50%';
|
||||
el.style.transform = 'scale(5)';
|
||||
el.style.opacity = '0';
|
||||
trash.dataset['open'] = 'true';
|
||||
const el = document.createElement("div");
|
||||
el.style.position = "fixed";
|
||||
el.style.top = "0";
|
||||
el.style.left = "0";
|
||||
el.style.width = "15px";
|
||||
el.style.height = "15px";
|
||||
el.style.backgroundColor = "var(--gray-7)";
|
||||
el.style.zIndex = "60";
|
||||
el.style.borderRadius = "50%";
|
||||
el.style.transform = "scale(5)";
|
||||
el.style.opacity = "0";
|
||||
trash.dataset["open"] = "true";
|
||||
const initial = {
|
||||
x: scopeRect.left + scopeRect.width / 2,
|
||||
y: scopeRect.top + scopeRect.height / 2,
|
||||
|
|
@ -134,35 +124,35 @@ export function SpaceItem({
|
|||
animateItem(itemRef.current, SpaceExitVariant, {
|
||||
duration: 0.2,
|
||||
}).then(() => {
|
||||
itemRef.current.style.scale = '0';
|
||||
itemRef.current.style.scale = "0";
|
||||
onDelete();
|
||||
});
|
||||
document.body.appendChild(el);
|
||||
el.animate(
|
||||
{
|
||||
transform: ['scale(5)', 'scale(1)'],
|
||||
transform: ["scale(5)", "scale(1)"],
|
||||
opacity: [0, 0.3, 1],
|
||||
},
|
||||
{
|
||||
duration: 200,
|
||||
easing: 'cubic-bezier(0.64, 0.57, 0.67, 1.53)',
|
||||
fill: 'forwards',
|
||||
easing: "cubic-bezier(0.64, 0.57, 0.67, 1.53)",
|
||||
fill: "forwards",
|
||||
},
|
||||
);
|
||||
el.animate(
|
||||
{
|
||||
offsetDistance: ['0%', '100%'],
|
||||
offsetDistance: ["0%", "100%"],
|
||||
},
|
||||
{
|
||||
duration: 2000,
|
||||
easing: 'cubic-bezier(0.64, 0.57, 0.67, 1.53)',
|
||||
fill: 'forwards',
|
||||
easing: "cubic-bezier(0.64, 0.57, 0.67, 1.53)",
|
||||
fill: "forwards",
|
||||
delay: 200,
|
||||
},
|
||||
).onfinish = () => {
|
||||
el.animate(
|
||||
{ transform: 'scale(0)', opacity: 0 },
|
||||
{ duration: 200, fill: 'forwards' },
|
||||
{ transform: "scale(0)", opacity: 0 },
|
||||
{ duration: 200, fill: "forwards" },
|
||||
).onfinish = () => {
|
||||
el.remove();
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue