PluginProbe
Image Optimizer – Compress Images and Convert to WebP or AVIF / 1.7.7
Image Optimizer – Compress Images and Convert to WebP or AVIF v1.7.7
1.7.7 1.7.6 1.7.5 1.7.4 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 All 33 releases
image-optimization / modules / reviews / assets / src / components / notification.js

notification.js in Image Optimizer – Compress Images and Convert to WebP or AVIF 1.7.7, at modules/reviews/assets/src/components/notification.js

40 lines 1004 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import CloseButton from '@elementor/ui/CloseButton';
2 import Snackbar from '@elementor/ui/Snackbar';
3 import SnackbarContent from '@elementor/ui/SnackbarContent';
4 import { useSettings } from '../hooks/use-settings';
5
6 const ReviewNotifications = ( { type, message } ) => {
7 const {
8 showNotification,
9 setShowNotification,
10 setNotificationMessage,
11 setNotificationType,
12 } = useSettings();
13
14 const closeNotification = () => {
15 setShowNotification( ! showNotification );
16 setNotificationMessage( '' );
17 setNotificationType( '' );
18 };
19
20 if ( ! showNotification ) {
21 return null;
22 }
23
24 return (
25 <Snackbar
26 open={ showNotification }
27 autoHideDuration={ type === 'error' ? 10000 : 2000 }
28 onClose={ closeNotification }
29 anchorOrigin={ { vertical: 'bottom', horizontal: 'right' } }
30 sx={ { zIndex: 99999 } }
31 >
32 <SnackbarContent
33 message={ message }
34 action={ <CloseButton color="inherit" onClick={ closeNotification } /> } />
35 </Snackbar>
36 );
37 };
38
39 export default ReviewNotifications;
40