PluginProbe
Image Optimizer – Compress Images and Convert to WebP or AVIF / 1.7.4
Image Optimizer – Compress Images and Convert to WebP or AVIF v1.7.4
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 / review-form.js

review-form.js in Image Optimizer – Compress Images and Convert to WebP or AVIF 1.7.4, at modules/reviews/assets/src/components/review-form.js

40 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import FormControl from '@elementor/ui/FormControl';
2 import Button from '@elementor/ui/Button';
3 import Typography from '@elementor/ui/Typography';
4 import { __ } from '@wordpress/i18n';
5 import useStorage from '../hooks/use-storage';
6 import { WORDPRESS_REVIEW_LINK } from '../constants';
7
8 const ReviewForm = ( { close } ) => {
9 const { save, get } = useStorage();
10
11 const handleSubmit = async () => {
12 await save( {
13 image_optimizer_review_data: {
14 ...get.data.image_optimizer_review_data,
15 repo_review_clicked: true,
16 },
17 } );
18
19 close();
20 window.open( WORDPRESS_REVIEW_LINK, '_blank' );
21 };
22
23 return (
24 <FormControl fullWidth>
25 <Typography variant="body1" marginBottom={ 1 }>
26 { __( 'It would mean a lot if you left us a quick review, so others can discover it too.', 'image-optimization' ) }
27 </Typography>
28 <Button
29 color="primary"
30 variant="contained"
31 onClick={ handleSubmit }
32 >
33 { __( 'Leave a review', 'image-optimization' ) }
34 </Button>
35 </FormControl>
36 );
37 };
38
39 export default ReviewForm;
40