PluginProbe ʕ •ᴥ•ʔ
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI / 3.5.2
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI v3.5.2
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 / Modules / components / CardsGrid.js
everest-forms / src / dashboard / screens / Modules / components Last commit date
AddonCard.js 3 weeks ago CardsGrid.js 3 months ago Categories.js 4 months ago Filters.js 3 months ago modules-api.js 1 year ago
CardsGrid.js
221 lines
1 import {
2 Box,
3 Divider,
4 HStack,
5 Heading,
6 SimpleGrid,
7 Text,
8 } from '@chakra-ui/react';
9 import AddonCard from './AddonCard';
10
11 const CardsGrid = ({ modules, selectedCategory, showToast, onModuleToggle }) => {
12 const getModulesByCategory = () => {
13 const modulesByCategory = new Map();
14
15 modules.forEach((module) => {
16 const category = module.category || 'Others';
17 if (!modulesByCategory.has(category)) {
18 modulesByCategory.set(category, []);
19 }
20 modulesByCategory.get(category).push(module);
21 });
22
23 const categoryOrder = [
24 'Form Elements',
25 'Payment Gateways',
26 'Email Marketing',
27 'CRM Integrations',
28 'Marketing & Analytics',
29 'Integrations',
30 'E-Commerce',
31 'Page Builders',
32 'Security',
33 'Cloud & Storage',
34 ];
35
36 const sortedCategories = [];
37
38 categoryOrder.forEach((categoryName) => {
39 if (modulesByCategory.has(categoryName)) {
40 sortedCategories.push([
41 categoryName,
42 modulesByCategory.get(categoryName),
43 ]);
44 }
45 });
46
47 modulesByCategory.forEach((categoryModules, category) => {
48 if (!categoryOrder.includes(category)) {
49 sortedCategories.push([category, categoryModules]);
50 }
51 });
52
53 return sortedCategories.map(([category, categoryModules]) => ({
54 category,
55 displayName: category,
56 modules: categoryModules,
57 }));
58 };
59
60 if (selectedCategory === 'All') {
61 const categoriesData = getModulesByCategory();
62
63 return (
64 <Box>
65 {categoriesData.map(
66 ({ category, displayName, modules: categoryModules }) => (
67 <Box
68 key={category}
69 mb={{ base: '4', sm: '5', md: '6' }}
70 bg="white"
71 p={{ base: '4', sm: '5', md: '6', lg: '8' }}
72 borderRadius="13px"
73 borderWidth="1px"
74 borderStyle="solid"
75 borderColor="#e1e1e1"
76 >
77 <HStack
78 justify="space-between"
79 mb={{ base: '3', sm: '4' }}
80 flexWrap="wrap"
81 gap="2"
82 >
83 <Heading
84 size={{ base: 'sm', sm: 'md' }}
85 color="gray.800"
86 fontWeight="600"
87 fontSize={{ base: '16px', sm: '18px', md: '20px' }}
88 >
89 {displayName}
90 </Heading>
91 <Text
92 fontSize={{ base: '12px', sm: '13px', md: '14px' }}
93 color="gray.500"
94 fontWeight="500"
95 flexShrink={0}
96 >
97 {categoryModules.length}{' '}
98 {categoryModules.length === 1 ? 'Item' : 'Items'}
99 </Text>
100 </HStack>
101 <Divider
102 mb={{ base: '5', sm: '6', md: '7' }}
103 borderColor="#e1e1e1"
104 opacity="1"
105 pb="4px"
106 />
107
108 <SimpleGrid
109 gridTemplateColumns="repeat(auto-fill, minmax(320px, 1fr))"
110 // columns={{ base: 1, md: 2, lg: 3 }}
111 spacing={{ base: '4', sm: '5', md: '6' }}
112 >
113 {categoryModules.map((addon) => (
114 <AddonCard
115 key={addon.slug}
116 addon={addon}
117 showToast={showToast}
118 onModuleToggle={onModuleToggle}
119 />
120 ))}
121 </SimpleGrid>
122 </Box>
123 ),
124 )}
125 </Box>
126 );
127 }
128
129 const categoryName =
130 selectedCategory !== 'All'
131 ? selectedCategory
132 : modules.length > 0
133 ? modules[0].category || 'Others'
134 : 'Others';
135
136 return (
137 <Box>
138 <Box
139 mb={{ base: '4', sm: '5', md: '6' }}
140 bg="white"
141 p={{ base: '4', sm: '5', md: '6', lg: '8' }}
142 borderRadius="13px"
143 borderWidth="1px"
144 borderStyle="solid"
145 borderColor="#e1e1e1"
146 >
147 <HStack
148 justify="space-between"
149 mb={{ base: '3', sm: '4' }}
150 flexWrap="wrap"
151 gap="2"
152 >
153 <Heading
154 size={{ base: 'sm', sm: 'md' }}
155 color="gray.800"
156 fontWeight="600"
157 fontSize={{ base: '16px', sm: '18px', md: '20px' }}
158 >
159 {categoryName}
160 </Heading>
161 <Text
162 fontSize={{ base: '12px', sm: '13px', md: '14px' }}
163 color="gray.500"
164 fontWeight="500"
165 flexShrink={0}
166 >
167 {modules.length} {modules.length === 1 ? 'Item' : 'Items'}
168 </Text>
169 </HStack>
170 <Divider mb={{ base: '5', sm: '6', md: '7' }} borderColor="#e1e1e1" opacity="1" pb="4px" />
171
172 {modules.length > 0 ? (
173 <SimpleGrid
174 // columns={{ base: 1, md: 2, lg: 3 }}
175 // spacing={{ base: '4', sm: '5', md: '6' }}
176
177 gridTemplateColumns="repeat(auto-fill, minmax(320px, 1fr))"
178 spacing={{ base: '4', sm: '5', md: '6' }}
179 >
180 {modules.map((addon) => (
181 <AddonCard
182 key={addon.slug}
183 addon={addon}
184 showToast={showToast}
185 onModuleToggle={onModuleToggle}
186 />
187 ))}
188 </SimpleGrid>
189 ) : (
190 <Box
191 display="flex"
192 justifyContent="center"
193 flexDirection="column"
194 padding={{ base: '30px 16px', sm: '40px 20px', md: '60px' }}
195 gap={{ base: '2', sm: '3' }}
196 alignItems="center"
197 textAlign="center"
198 >
199 <Text
200 fontSize={{ base: '14px', sm: '15px', md: '16px' }}
201 fontWeight="500"
202 color="gray.600"
203 >
204 No modules found
205 </Text>
206 <Text
207 fontSize={{ base: '13px', sm: '14px' }}
208 color="gray.500"
209 px={{ base: '2', sm: '4' }}
210 >
211 No addons are available in the {categoryName} category.
212 </Text>
213 </Box>
214 )}
215 </Box>
216 </Box>
217 );
218 };
219
220 export default CardsGrid;
221