PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.11.1
Code Block Pro – Beautiful Syntax Highlighting v1.11.1
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
code-block-pro / src / editor / components / Notice.tsx

Notice.tsx in Code Block Pro – Beautiful Syntax Highlighting 1.11.1, at src/editor/components/Notice.tsx

44 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { __ } from '@wordpress/i18n';
2 import { useSettingsStore, useSettingsStoreReady } from '../../state/settings';
3
4 export const Notice = ({
5 message,
6 callback,
7 href,
8 seenKey,
9 }: {
10 message: string;
11 callback?: () => void;
12 href: string;
13 seenKey: string;
14 }) => {
15 const { seenNotices, setSeenNotice } = useSettingsStore();
16 const ready = useSettingsStoreReady();
17
18 return null;
19 if (!ready) return null;
20 if (seenNotices.includes(seenKey)) return null;
21
22 return (
23 <div className="relative bg-gray-100 hover:bg-blue-100">
24 <button
25 className="absolute top-0 right-0 border-0 mt-1 mr-2 leading-none p-0 bg-transparent cursor-pointer"
26 title={__('Dismiss', 'code-block-pro')}
27 type="button"
28 onClick={() => setSeenNotice(seenKey)}>
29 x
30 </button>
31
32 <a
33 className="block p-4 underline caret-pink-600 m-0 bg-clip-text text-transparent bg-gradient-to-r from-blue-500 to-teal-500 text-left text-base leading-5 font-medium cursor-pointer border-0"
34 href={href}
35 target="_blank"
36 rel="noreferrer"
37 title={__('Press here', 'code-block-pro')}
38 onClick={callback}>
39 {message}
40 </a>
41 </div>
42 );
43 };
44