forked from Automattic/wp-calypso
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.tsx
54 lines (50 loc) · 1.27 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */
/* eslint-disable jsx-a11y/click-events-have-key-events */
import PropTypes from 'prop-types';
import WapuuEar from 'calypso/assets/images/odie/wapuu-ear.svg';
import Wapuu from 'calypso/assets/images/odie/wapuu-noear-notail.svg';
import WapuuTail from 'calypso/assets/images/odie/wapuu-tail.svg';
const WapuuRibbon = ( {
onToggleVisibility,
isNudging,
isLoading,
}: {
onToggleVisibility: () => void;
isNudging: boolean;
isLoading: boolean;
} ) => {
const handleToggleVisibility = () => {
onToggleVisibility();
};
return (
<>
<img
role="button"
src={ Wapuu }
alt="Chat"
className="wapuu-image chatbox-toggle"
onClick={ handleToggleVisibility }
/>
<img
role="button"
src={ WapuuEar }
alt="Chat"
className={ `wapuu-ear-image chatbox-toggle ${ isNudging ? 'wapuu-animation-nudge' : '' }` }
onClick={ handleToggleVisibility }
/>
<img
role="button"
src={ WapuuTail }
alt="Chat"
className={ `wapuu-tail-image chatbox-toggle ${
isLoading ? 'wapuu-animation-loading' : ''
}` }
onClick={ handleToggleVisibility }
/>
</>
);
};
WapuuRibbon.propTypes = {
onToggleVisibility: PropTypes.func.isRequired,
};
export default WapuuRibbon;