PluginProbe
Extendify / 3.1.4
Extendify v3.1.4
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 / AutoLaunch / components / MigrateChoice.jsx

MigrateChoice.jsx in Extendify 3.1.4, at src/AutoLaunch/components/MigrateChoice.jsx

55 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { ChoiceBox } from '@auto-launch/components/ChoiceBox';
2 import { checkIn } from '@auto-launch/functions/insights';
3 import { sparkles } from '@auto-launch/icons';
4 import { useEffect } from '@wordpress/element';
5 import { __ } from '@wordpress/i18n';
6 import { cloudUpload } from '@wordpress/icons';
7 import { motion } from 'framer-motion';
8
9 const getMigrateSearchUrl = () =>
10 `${window.extSharedData.adminUrl}plugin-install.php?tab=search&s=${encodeURIComponent(
11 __('migration', 'extendify-local'),
12 )}`;
13
14 export const MigrateChoice = ({ onBuildNew }) => {
15 useEffect(() => {
16 checkIn({ stage: 'migrate_screen' });
17 }, []);
18
19 return (
20 <motion.div
21 animate={{ opacity: 1 }}
22 exit={{ opacity: 0 }}
23 transition={{ duration: 0.4 }}
24 className="grid w-full gap-6 sm:mx-auto sm:max-w-xl sm:grid-cols-2 sm:items-start sm:pt-7"
25 >
26 <ChoiceBox
27 icon={cloudUpload}
28 buttonLabel={__('Migrate website', 'extendify-local')}
29 description={__(
30 'Import an existing WordPress website',
31 'extendify-local',
32 )}
33 onClick={() => {
34 checkIn({ stage: 'migrate_screen_migrate' });
35 window.location.assign(getMigrateSearchUrl());
36 }}
37 />
38 <ChoiceBox
39 icon={sparkles}
40 highlight
41 badgeLabel={__('Most Popular', 'extendify-local')}
42 buttonLabel={__('Build a new website', 'extendify-local')}
43 description={__(
44 'Create a beautiful website in about a minute',
45 'extendify-local',
46 )}
47 onClick={() => {
48 checkIn({ stage: 'migrate_screen_build' });
49 onBuildNew();
50 }}
51 />
52 </motion.div>
53 );
54 };
55