aboutsummaryrefslogtreecommitdiff
path: root/apps/web/src/components/Sidebar
diff options
context:
space:
mode:
authorYash <[email protected]>2024-04-05 09:20:44 +0000
committerYash <[email protected]>2024-04-05 09:20:44 +0000
commit25e7e5f0513ae73c09ed57db5bb6055c18c8d180 (patch)
treebc66167ff3649569fb9659823198188d76d815a0 /apps/web/src/components/Sidebar
parentfix type error (diff)
downloadsupermemory-25e7e5f0513ae73c09ed57db5bb6055c18c8d180.tar.xz
supermemory-25e7e5f0513ae73c09ed57db5bb6055c18c8d180.zip
remove unused imports
Diffstat (limited to 'apps/web/src/components/Sidebar')
-rw-r--r--apps/web/src/components/Sidebar/MemoriesBar.tsx76
1 files changed, 33 insertions, 43 deletions
diff --git a/apps/web/src/components/Sidebar/MemoriesBar.tsx b/apps/web/src/components/Sidebar/MemoriesBar.tsx
index 9fcd3ff8..88caec9c 100644
--- a/apps/web/src/components/Sidebar/MemoriesBar.tsx
+++ b/apps/web/src/components/Sidebar/MemoriesBar.tsx
@@ -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();
};