Skip to content

Commit

Permalink
use framer motion for doing the text feedback fade-out animation
Browse files Browse the repository at this point in the history
blame @ashen-dawn for this choice of library i am blindly following their guidance
  • Loading branch information
eritbh committed Jan 25, 2024
1 parent da081a1 commit 0f942d1
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 8 deletions.
15 changes: 11 additions & 4 deletions extension/data/components/TextFeedbackContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {AnimatePresence, motion} from 'framer-motion';
import {useSelector} from 'react-redux';
import {RootState} from '../store';
import {TextFeedbackLocation} from '../store/textFeedbackSlice';
Expand All @@ -20,12 +21,18 @@ export function TextFeedbackContainer () {
} as const;

return (
<>
<AnimatePresence>
{currentMessage && (
<div id='tb-feedback-window' className={currentMessage.kind} style={style}>
<motion.div
id='tb-feedback-window'
className={currentMessage.kind}
style={style}
animate={{opacity: 1}}
exit={{opacity: 0}}
>
<span className='tb-feedback-text'>{currentMessage.message}</span>
</div>
</motion.div>
)}
</>
</AnimatePresence>
);
}
69 changes: 65 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@reduxjs/toolkit": "^2.1.0",
"codemirror": "^5.65.15",
"dompurify": "^3.0.5",
"framer-motion": "^11.0.3",
"iter-ops": "^3.1.1",
"jquery": "^3.7.1",
"pako": "^0.2.6",
Expand Down

0 comments on commit 0f942d1

Please sign in to comment.