File size: 2,221 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import { recordTracksEvent } from '@automattic/calypso-analytics';
import { Button, Gridicon } from '@automattic/components';
import { useTranslate } from 'i18n-calypso';
import { useEffect } from 'react';
import ActionPanel from 'calypso/components/action-panel';
import ActionPanelBody from 'calypso/components/action-panel/body';
import ActionPanelFigure from 'calypso/components/action-panel/figure';
import ActionPanelTitle from 'calypso/components/action-panel/title';
import { useDispatch } from 'calypso/state';
import { savePreference } from 'calypso/state/preferences/actions';

export const COMMENTS_TIPS_DISMISSED_PREFERENCE = 'dismissible-comments-moderation-tips';

const CommentTips = () => {
	const translate = useTranslate();
	const dispatch = useDispatch();

	const dismissTips = () => {
		dispatch( savePreference( COMMENTS_TIPS_DISMISSED_PREFERENCE, true ) );
		recordTracksEvent( 'calypso_comments_moderation_tips_dismissed' );
	};

	useEffect( () => {
		recordTracksEvent( 'calypso_comments_moderation_tips_viewed' );
	}, [] );

	return (
		<ActionPanel className="comments-tips__action-panel">
			<Button
				className="comments-tips__dismiss-button"
				onClick={ dismissTips }
				borderless
				title={ translate( 'Dismiss tips' ) }
			>
				<Gridicon icon="cross" size="24px" />
			</Button>
			<ActionPanelBody>
				<ActionPanelFigure align="left">
					<img
						src="/calypso/images/wordpress/logo-stars.svg"
						width="170"
						height="143"
						alt="WordPress logo"
					/>
				</ActionPanelFigure>
				<ActionPanelTitle>{ translate( 'A few helpful tips' ) }</ActionPanelTitle>
				<ul>
					<li>
						{ translate(
							'Comments are the best part of blogging, but you decide which comments get published.'
						) }
					</li>
					<li>
						{ translate(
							'Spammers and odd folks will want to be on your post so look at their links and if it seems scammy, don’t hesitate to delete or spam the comment.'
						) }
					</li>
					<li>
						{ translate(
							'When real people show up, approve the comment and reply to them! Engage them, this is your community.'
						) }
					</li>
				</ul>
			</ActionPanelBody>
		</ActionPanel>
	);
};

export default CommentTips;