import React, { Component } from 'react'; import { Transition } from 'react-transition-group'; import Chatbox from './chatbox'; import './styles.scss'; class Widget extends Component { constructor(props) { super(props); this.state = { opened: false, showDock: true, }; } handleToggleOpen = () => { this.setState((prev) => { let { showDock } = prev; if (!prev.opened) { showDock = false; } return { showDock, opened: !prev.opened, }; }); } handleWidgetExit = () => { this.setState({ showDock: true, }); } render() { const { opened, showDock } = this.state; return (