PluginProbe
Extendify / 3.1.6
Extendify v3.1.6
3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 All 127 releases
extendify / src / Assist / components / dashboard / buttons / TourButton.jsx

TourButton.jsx in Extendify 3.1.6, at src/Assist/components/dashboard/buttons/TourButton.jsx

31 lines 798 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { __ } from '@wordpress/i18n';
2
3 export const TourButton = ({ task, completed }) => {
4 const startTour = (slug) =>
5 window.dispatchEvent(
6 new CustomEvent('extendify-assist:start-tour', {
7 detail: { tourSlug: slug },
8 }),
9 );
10
11 return (
12 <div className="">
13 <button
14 type="button"
15 className="hidden min-w-24 rounded-xs bg-design-main px-4 py-2.5 text-sm font-medium text-design-text hover:opacity-90 md:block"
16 onClick={() => startTour(task.slug)}
17 >
18 {completed
19 ? task.buttonLabels.completed
20 : task.buttonLabels.notCompleted}
21 </button>
22 <div className="rounded-xs border bg-gray-100 px-2 py-2 text-gray-700 sm:block md:hidden">
23 {__(
24 'This tour is only available on desktop devices',
25 'extendify-local',
26 )}
27 </div>
28 </div>
29 );
30 };
31