Skip to content

Commit

Permalink
Animation added
Browse files Browse the repository at this point in the history
  • Loading branch information
gylychmedov committed Sep 4, 2021
1 parent 4ee1e11 commit caa8a7a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/components/Animate/Animations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export const slideBottom = {
show: {
y: 0,
},
hide: {
y: -20,
},
};
9 changes: 7 additions & 2 deletions src/components/Contact/ContactList.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import {
deleteContactAction,
setFormUpdateContactAction,
} from "../../store/actions/contactActions";
import { motion } from "framer-motion";
import { slideBottom } from "../Animate/Animations";

const ContactList = () => {
const dispatch = useDispatch();
Expand All @@ -15,7 +17,10 @@ const ContactList = () => {
{contacts.contacts.length > 0 &&
contacts.contacts.map((contact, key) => {
return (
<aside
<motion.aside
variants={slideBottom}
initial="hide"
animate="show"
key={key}
className={`bg-opacity-50 rounded-xl w-full lg:w-8/12 px-5 py-3 flex items-center justify-between ${
contacts.form.id == contact.id ? "bg-green-200" : "bg-white"
Expand Down Expand Up @@ -47,7 +52,7 @@ const ContactList = () => {
<CgTrashEmpty />
</div>
</div>
</aside>
</motion.aside>
);
})}
</main>
Expand Down

1 comment on commit caa8a7a

@vercel
Copy link

@vercel vercel bot commented on caa8a7a Feb 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.