PluginProbe
Extendify / 1.6.1
Extendify v1.6.1
3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 0.7.0 All 126 releases
extendify / src / Chat / Chat.js

Chat.js in Extendify 1.6.1, at src/Chat/Chat.js

34 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { useState } from '@wordpress/element'
2 import { ChatButton } from '@chat/components/ChatButton'
3 import { ChatDialog } from '@chat/components/ChatDialog'
4 import { motion, AnimatePresence } from 'framer-motion'
5
6 export const Chat = () => {
7 const [showDialog, setShowDialog] = useState(false)
8
9 return (
10 <>
11 <ChatButton
12 showDialog={showDialog}
13 onClick={() => setShowDialog(!showDialog)}
14 />
15 <AnimatePresence>
16 {showDialog && (
17 <motion.div
18 key="chat-dialog"
19 className="fixed bottom-0 right-0"
20 initial={{ y: 15, opacity: 0 }}
21 exit={{ y: 15, opacity: 0 }}
22 transition={{
23 y: { duration: 0.25 },
24 opacity: { duration: 0.1 },
25 }}
26 animate={{ y: 0, opacity: 1 }}>
27 <ChatDialog />
28 </motion.div>
29 )}
30 </AnimatePresence>
31 </>
32 )
33 }
34