PluginProbe ʕ •ᴥ•ʔ
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI / 3.0.0
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI v3.0.0
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 2 years ago
Header.js
217 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 position={{
59 sm: "sticky",
60 }}
61 top="var(--wp-admin--admin-bar--height, 0)"
62 bg={"white"}
63 zIndex={1}
64 borderBottom="1px solid #E9E9E9"
65 width="100%"
66 >
67 <Container maxW="container.xl">
68 <Stack
69 direction="row"
70 minH="70px"
71 justify="space-between"
72 px="6"
73 >
74 <Stack direction="row" align="center" gap="7">
75 <Link as={NavLink} to="/dashboard">
76 <EVF h="10" w="10" />
77 </Link>
78 <IntersectObserver routes={ROUTES}>
79 {ROUTES.map(({ route, label }) => (
80 <Link
81 data-target={route}
82 key={route}
83 as={NavLink}
84 to={route}
85 fontSize="sm"
86 fontWeight="semibold"
87 lineHeight="150%"
88 color="#383838"
89 _hover={{
90 color: "primary.500",
91 }}
92 _focus={{
93 boxShadow: "none",
94 }}
95 _activeLink={{
96 color: "primary.500",
97 borderBottom: "3px solid",
98 borderColor: "primary.500",
99 marginBottom: "-2px",
100 }}
101 display="inline-flex"
102 alignItems="center"
103 px="2"
104 h="full"
105 >
106 {label}
107 {route === "/settings" && (
108 <ExternalLink
109 h="4"
110 w="4"
111 marginLeft="4px"
112 marginBottom="3px"
113 />
114 )}
115 </Link>
116 ))}
117 </IntersectObserver>
118 </Stack>
119 <Stack direction="row" align="center" spacing="12px">
120 <Tooltip
121 label={sprintf(
122 __(
123 "You are currently using Everest Forms %s",
124 "everest-forms"
125 ),
126 (isPro && "Pro ") + "v" + version
127 )}
128 >
129 <Tag
130 variant="outline"
131 colorScheme="primary"
132 borderRadius="xl"
133 bgColor="#F8FAFF"
134 fontSize="xs"
135 >
136 {"v" + version}
137 </Tag>
138 </Tooltip>
139 <Center height="18px">
140 <Divider orientation="vertical" />
141 </Center>
142 {!isPro && (
143 <Link
144 color="#2563EB"
145 fontSize="12px"
146 height="18px"
147 w="85px"
148 href={
149 upgradeURL +
150 "&utm_source=dashboard-header&utm_medium=top-menu-link"
151 }
152 isExternal
153 >
154 {__("Upgrade To Pro", "everest-forms")}
155 </Link>
156 )}
157 <Button
158 onClick={onOpen}
159 variant="unstyled"
160 borderRadius="full"
161 border="2px"
162 borderColor="gray.200"
163 w="40px"
164 h="40px"
165 position="relative"
166 >
167 <Tooltip
168 label={__(
169 "Latest Updates",
170 "everest-forms"
171 )}
172 >
173 <Image
174 src={announcement}
175 alt="announcement"
176 h="35px"
177 w="35px"
178 position="absolute"
179 top="50%"
180 left="50%"
181 transform="translate(-40%, -50%)"
182 />
183 </Tooltip>
184 </Button>
185 </Stack>
186 </Stack>
187 </Container>
188 </Box>
189 <Drawer
190 isOpen={isOpen}
191 placement="right"
192 onClose={onClose}
193 finalFocusRef={ref}
194 >
195 <DrawerOverlay
196 bgColor="rgb(0,0,0,0.05)"
197 sx={{ backdropFilter: "blur(1px)" }}
198 />
199 <DrawerContent
200 className="everest-forms-announcement"
201 top="var(--wp-admin--admin-bar--height, 0) !important"
202 >
203 <DrawerCloseButton />
204 <DrawerHeader>
205 {__("Latest Updates", "everest-forms")}
206 </DrawerHeader>
207 <DrawerBody>
208 <Changelog />
209 </DrawerBody>
210 </DrawerContent>
211 </Drawer>
212 </>
213 );
214 };
215
216 export default Header;
217