PluginProbe ʕ •ᴥ•ʔ
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI / 3.2.4
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI v3.2.4
3.6.0 3.5.3 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 / components / Header / Header.js
everest-forms / src / dashboard / components / Header Last commit date
Header.js 1 year ago
Header.js
214 lines
1 /**
2 * External Dependencies
3 */
4 import {
5 Box,
6 Button,
7 Container,
8 Drawer,
9 DrawerBody,
10 DrawerCloseButton,
11 DrawerContent,
12 DrawerHeader,
13 DrawerOverlay,
14 Image,
15 Link,
16 Stack,
17 Tag,
18 Text,
19 useDisclosure,
20 Divider,
21 Center,
22 Tooltip,
23 } from "@chakra-ui/react";
24 import { __ } from "@wordpress/i18n";
25 import React, { useEffect, useRef } from "react";
26 import { NavLink } from "react-router-dom";
27
28 /**
29 * Internal Dependencies
30 */
31 import ROUTES from "../../Constants";
32 import announcement from "../../images/announcement.gif";
33 import { EVF, ExternalLink } from "../Icon/Icon";
34 import IntersectObserver from "../IntersectionObserver/IntersectionObserver";
35 import Changelog from "../Changelog/Changelog";
36
37 const Header = () => {
38 const { isOpen, onOpen, onClose } = useDisclosure();
39 const ref = useRef();
40
41 /* global _UR_DASHBOARD_ */
42 const { version, isPro, upgradeURL } =
43 typeof _EVF_DASHBOARD_ !== "undefined" && _EVF_DASHBOARD_;
44 useEffect(() => {
45 if (isOpen) {
46 document.body.classList.add("ur-modal-open");
47 } else {
48 document.body.classList.remove("ur-modal-open");
49 }
50 return () => {
51 document.body.classList.remove("ur-modal-open");
52 };
53 }, [isOpen]);
54
55 return (
56 <>
57 <Box
58 top="var(--wp-admin--admin-bar--height, 0)"
59 bg={"white"}
60 borderBottom="1px solid #E9E9E9"
61 width="100%"
62 >
63 <Container maxW="container.xl">
64 <Stack
65 direction="row"
66 minH="70px"
67 justify="space-between"
68 px="6"
69 >
70 <Stack direction="row" align="center" gap="7">
71 <Link as={NavLink} to="/dashboard">
72 <EVF h="10" w="10" />
73 </Link>
74 <IntersectObserver routes={ROUTES}>
75 {ROUTES.map(({ route, label }) => (
76 <Link
77 data-target={route}
78 key={route}
79 as={NavLink}
80 to={route}
81 fontSize="sm"
82 fontWeight="semibold"
83 lineHeight="150%"
84 color="#383838"
85 _hover={{
86 color: "primary.500",
87 }}
88 _focus={{
89 boxShadow: "none",
90 }}
91 _activeLink={{
92 color: "primary.500",
93 borderBottom: "3px solid",
94 borderColor: "primary.500",
95 marginBottom: "-2px",
96 }}
97 display="inline-flex"
98 alignItems="center"
99 px="2"
100 h="full"
101 >
102 {label}
103 {route === "/settings" && (
104 <ExternalLink
105 h="4"
106 w="4"
107 marginLeft="4px"
108 marginBottom="3px"
109 />
110 )}
111 </Link>
112 ))}
113 </IntersectObserver>
114 </Stack>
115 <Stack direction="row" align="center" spacing="12px">
116 <Tooltip
117 label={sprintf(
118 __(
119 "You are currently using Everest Forms %s",
120 "everest-forms"
121 ),
122 (isPro && "Pro ") + "v" + version
123 )}
124 >
125 <Tag
126 variant="outline"
127 colorScheme="primary"
128 borderRadius="xl"
129 bgColor="#F8FAFF"
130 fontSize="xs"
131 >
132 {"v" + version}
133 </Tag>
134 </Tooltip>
135 <Center height="18px">
136 <Divider orientation="vertical" />
137 </Center>
138 {!isPro && (
139 <Link
140 color="#2563EB"
141 fontSize="12px"
142 height="18px"
143 w="85px"
144 href={
145 upgradeURL +
146 "&utm_source=dashboard-header&utm_medium=top-menu-link"
147 }
148 isExternal
149 >
150 {__("Upgrade To Pro", "everest-forms")}
151 </Link>
152 )}
153 <Button
154 onClick={onOpen}
155 variant="unstyled"
156 borderRadius="full"
157 border="2px"
158 borderColor="gray.200"
159 w="40px"
160 h="40px"
161 position="relative"
162 >
163 <Tooltip
164 label={__(
165 "Latest Updates",
166 "everest-forms"
167 )}
168 >
169 <Image
170 src={announcement}
171 alt="announcement"
172 h="35px"
173 w="35px"
174 position="absolute"
175 top="50%"
176 left="50%"
177 transform="translate(-40%, -50%)"
178 />
179 </Tooltip>
180 </Button>
181 </Stack>
182 </Stack>
183 </Container>
184 </Box>
185 <Drawer
186 isOpen={isOpen}
187 placement="right"
188 onClose={onClose}
189 finalFocusRef={ref}
190 size="md"
191 >
192 <DrawerOverlay
193 bgColor="rgb(0,0,0,0.05)"
194 sx={{ backdropFilter: "blur(1px)" }}
195 />
196 <DrawerContent
197 className="everest-forms-announcement"
198 top="var(--wp-admin--admin-bar--height, 0) !important"
199 >
200 <DrawerCloseButton />
201 <DrawerHeader>
202 {__("Latest Updates", "everest-forms")}
203 </DrawerHeader>
204 <DrawerBody>
205 <Changelog />
206 </DrawerBody>
207 </DrawerContent>
208 </Drawer>
209 </>
210 );
211 };
212
213 export default Header;
214