mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-25 12:22:58 +03:00
style: Exit animation
This commit is contained in:
parent
e360683093
commit
329163a128
@ -34,6 +34,7 @@ const DocumentItem = ({ document, setDocuments }: DocumentProps) => {
|
|||||||
<AnimatedCard
|
<AnimatedCard
|
||||||
initial={{ x: -64, opacity: 0 }}
|
initial={{ x: -64, opacity: 0 }}
|
||||||
animate={{ x: 0, opacity: 1 }}
|
animate={{ x: 0, opacity: 1 }}
|
||||||
|
exit={{ x: 64, opacity: 0 }}
|
||||||
className="flex items-center justify-between w-full p-5 gap-10"
|
className="flex items-center justify-between w-full p-5 gap-10"
|
||||||
>
|
>
|
||||||
<p className="text-lg leading-tight max-w-sm">{document.name}</p>
|
<p className="text-lg leading-tight max-w-sm">{document.name}</p>
|
||||||
|
@ -6,6 +6,7 @@ import { Document } from "./types";
|
|||||||
import Button from "../components/ui/Button";
|
import Button from "../components/ui/Button";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import Spinner from "../components/ui/Spinner";
|
import Spinner from "../components/ui/Spinner";
|
||||||
|
import { AnimatePresence } from "framer-motion";
|
||||||
|
|
||||||
export default function ExplorePage() {
|
export default function ExplorePage() {
|
||||||
const [documents, setDocuments] = useState<Document[]>([]);
|
const [documents, setDocuments] = useState<Document[]>([]);
|
||||||
@ -43,13 +44,15 @@ export default function ExplorePage() {
|
|||||||
) : (
|
) : (
|
||||||
<div className="w-full max-w-xl flex flex-col gap-5">
|
<div className="w-full max-w-xl flex flex-col gap-5">
|
||||||
{documents.length !== 0 ? (
|
{documents.length !== 0 ? (
|
||||||
documents.map((document, index) => (
|
<AnimatePresence>
|
||||||
<DocumentItem
|
{documents.map((document) => (
|
||||||
key={index}
|
<DocumentItem
|
||||||
document={document}
|
key={document.name}
|
||||||
setDocuments={setDocuments}
|
document={document}
|
||||||
/>
|
setDocuments={setDocuments}
|
||||||
))
|
/>
|
||||||
|
))}
|
||||||
|
</AnimatePresence>
|
||||||
) : (
|
) : (
|
||||||
<div className="flex flex-col items-center justify-center mt-10 gap-1">
|
<div className="flex flex-col items-center justify-center mt-10 gap-1">
|
||||||
<p className="text-center">Oh No, Your Brain is empty.</p>
|
<p className="text-center">Oh No, Your Brain is empty.</p>
|
||||||
|
Loading…
Reference in New Issue
Block a user