PluginProbe ʕ •ᴥ•ʔ
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI / 3.5.0
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI v3.5.0
3.5.2 3.5.1 3.5.0 3.4.8 3.4.7 3.4.6 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.5.1 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.10 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.6.1 1.6.7 1.7.0 1.7.0.1 1.7.0.2 1.7.0.3 1.7.1 1.7.2 1.7.2.1 1.7.2.2 1.7.3 1.7.4 1.7.5 1.7.5.1 1.7.5.2 1.7.6 1.7.7 1.7.7.1 1.7.7.2 1.7.8 1.7.9 1.8.0 1.8.0.1 1.8.1 1.8.2 1.8.2.1 1.8.2.2 1.8.2.3 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9.0 1.9.0.1 1.9.1 1.9.2 1.9.3 1.9.4 1.9.4.1 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.0.1 2.0.1 2.0.2 2.0.3 2.0.3.1 2.0.4 2.0.4.1 2.0.5 2.0.6 2.0.7 2.0.8 2.0.8.1 2.0.9 3.0.0 3.0.0.1 3.0.1 3.0.2 3.0.3 3.0.3.1 3.0.4 3.0.4.1 3.0.4.2 3.0.5 3.0.5.1 3.0.5.2 3.0.6 3.0.6.1 3.0.7.1 3.0.8 3.0.8.1 3.0.9 3.0.9.1 3.0.9.2 3.0.9.3 3.0.9.4 3.0.9.5 3.1.0 3.1.1 3.1.2 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.3.0 3.4.0 3.4.1 3.4.2 3.4.2.1 3.4.3 3.4.4 3.4.5 trunk 1.0 1.0.1 1.0.2 1.0.3
everest-forms / src / dashboard / screens / SiteAssistant / components / UsefulPlugins.js
everest-forms / src / dashboard / screens / SiteAssistant / components Last commit date
UsefulPlugins.js 5 months ago
UsefulPlugins.js
156 lines
1 /**
2 * External Dependencies
3 */
4 import {
5 AlertDialog,
6 AlertDialogBody,
7 AlertDialogContent,
8 AlertDialogFooter,
9 AlertDialogHeader,
10 AlertDialogOverlay,
11 Button,
12 Grid,
13 Heading,
14 HStack,
15 Stack,
16 Text,
17 useDisclosure,
18 } from "@chakra-ui/react";
19 import { sprintf, __ } from "@wordpress/i18n";
20 import React, { useRef, useState, useEffect, useContext } from "react";
21
22 /**
23 * Internal Dependencies
24 */
25 import { PLUGINS } from "../../../Constants/Products";
26 import DashboardContext, {
27 DashboardProvider,
28 } from "../../../context/DashboardContext";
29 import UsePluginInstallActivate from "../../../components/common/UsePluginInstallActivate";
30
31 const Plugin = ({ plugin, index }) => {
32 const { isOpen, onOpen, onClose } = useDisclosure();
33 const cancelRef = useRef();
34 const [isPluginStatusLoading, setIsPluginStatusLoading] = useState(false);
35 const [status, setStatus] = useState("inactive");
36 const [{ pluginsStatus, themesStatus }, dispatch] =
37 useContext(DashboardContext);
38
39 useEffect(() => {
40 const status =
41 plugin.type === "theme"
42 ? themesStatus[plugin.slug]
43 : pluginsStatus[plugin.slug];
44 setStatus(status);
45 }, [pluginsStatus[plugin.slug], themesStatus[plugin.slug]]);
46 return (
47 <HStack
48 key={plugin.slug}
49 gap="4px"
50 justify="space-between"
51 px="16px"
52 py="18px"
53 pl={index % 2 === 0 ? "0" : undefined}
54 >
55 <HStack>
56 <plugin.logo w="40px" h="40px" />
57 <Stack gap="6px">
58 <Heading as="h4" fontSize="14px" fontWeight="semibold">
59 {plugin.label}
60 </Heading>
61 <Text as="span" color="gray.500">
62 {plugin.shortDescription}
63 </Text>
64 </Stack>
65 </HStack>
66 <Button
67 variant="link"
68 colorScheme="primary"
69 color="var(--chakra-colors-primary-500) !important"
70 fontSize="14px"
71 fontWeight="normal"
72 textDecor="underline"
73 isLoading={isPluginStatusLoading}
74 isDisabled={"active" === status}
75 onClick={onOpen}
76 >
77 {status === "active"
78 ? __("Active", "everest-forms")
79 : status === "inactive"
80 ? __("Activate", "everest-forms")
81 : __("Install", "everest-forms")}
82 </Button>
83 <AlertDialog
84 isOpen={isOpen}
85 leastDestructiveRef={cancelRef}
86 onClose={onClose}
87 isCentered
88 >
89 <AlertDialogOverlay>
90 <AlertDialogContent>
91 <AlertDialogHeader fontSize="lg" fontWeight="semibold">
92 {"inactive" === status
93 ? __("Activate Plugin", "everest-forms")
94 : __("Install Plugin", "everest-forms")}
95 </AlertDialogHeader>
96 <AlertDialogBody>
97 {"inactive" === status
98 ? sprintf(
99 __(
100 "Are you sure? You want to activate %s plugin.",
101 "everest-forms"
102 ),
103 plugin.label
104 )
105 : sprintf(
106 __(
107 "Are you sure? You want to install and activate %s plugin.",
108 "everest-forms"
109 ),
110 plugin.label
111 )}
112 </AlertDialogBody>
113 <AlertDialogFooter>
114 <UsePluginInstallActivate
115 cancelRef={cancelRef}
116 onClose={onClose}
117 slug={plugin.slug}
118 isPluginStatusLoading={isPluginStatusLoading}
119 setIsPluginStatusLoading={
120 setIsPluginStatusLoading
121 }
122 />
123 </AlertDialogFooter>
124 </AlertDialogContent>
125 </AlertDialogOverlay>
126 </AlertDialog>
127 </HStack>
128 );
129 };
130
131 const UsefulPlugins = () => {
132 return (
133 <Grid
134 gridTemplateColumns="1fr 1fr"
135 sx={{
136 "> div:nth-child(2n+1)": {
137 borderRight: "1px",
138 borderColor: "gray.100",
139 },
140 "> div:first-child, > div:nth-child(2)": {
141 borderBottom: "1px",
142 borderColor: "gray.100",
143 },
144 }}
145 >
146 <DashboardProvider>
147 {PLUGINS.map((plugin, i) => (
148 <Plugin key={plugin.slug} plugin={plugin} index={i} />
149 ))}
150 </DashboardProvider>
151 </Grid>
152 );
153 };
154
155 export default UsefulPlugins;
156