@webbycrown/webbycommerce 1.2.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -3
- package/admin/app.js +3 -0
- package/admin/jsconfig.json +20 -0
- package/admin/src/components/ApiCollectionsContent.jsx +4626 -0
- package/admin/src/components/CompareContent.jsx +300 -0
- package/admin/src/components/ConfigureContent.jsx +407 -0
- package/admin/src/components/Initializer.jsx +64 -0
- package/admin/src/components/LoginRegisterContent.jsx +280 -0
- package/admin/src/components/PluginIcon.jsx +6 -0
- package/admin/src/components/ShippingTypeContent.jsx +230 -0
- package/admin/src/components/SmtpContent.jsx +316 -0
- package/admin/src/components/WishlistContent.jsx +273 -0
- package/admin/src/index.js +81 -0
- package/admin/src/pages/ApiCollections.jsx +169 -0
- package/admin/src/pages/Configure.jsx +55 -0
- package/admin/src/pages/Settings.jsx +93 -0
- package/admin/src/pluginId.js +4 -0
- package/{dist/_chunks/en-CiQ97iC8.js → admin/src/translations/en.json} +712 -574
- package/bin/setup.js +50 -3
- package/package.json +14 -13
- package/server/bootstrap.js +3 -0
- package/server/register.js +3 -0
- package/server/src/bootstrap.js +3826 -0
- package/server/src/components/content-block.json +37 -0
- package/server/src/components/shipping-zone-location.json +27 -0
- package/server/src/config/index.js +7 -0
- package/server/src/content-types/address/index.js +7 -0
- package/server/src/content-types/address/schema.json +74 -0
- package/server/src/content-types/cart/index.js +61 -0
- package/server/src/content-types/cart-item/index.js +79 -0
- package/server/src/content-types/compare.js +73 -0
- package/server/src/content-types/coupon/index.js +7 -0
- package/server/src/content-types/coupon/schema.json +67 -0
- package/server/src/content-types/index.js +42 -0
- package/server/src/content-types/order/index.js +7 -0
- package/server/src/content-types/order/schema.json +121 -0
- package/server/src/content-types/payment-transaction/index.js +7 -0
- package/server/src/content-types/payment-transaction/schema.json +73 -0
- package/server/src/content-types/product/index.js +7 -0
- package/server/src/content-types/product/schema.json +104 -0
- package/server/src/content-types/product-attribute/index.js +7 -0
- package/server/src/content-types/product-attribute/schema.json +80 -0
- package/server/src/content-types/product-attribute-value/index.js +7 -0
- package/server/src/content-types/product-attribute-value/schema.json +52 -0
- package/server/src/content-types/product-category/index.js +7 -0
- package/server/src/content-types/product-category/schema.json +54 -0
- package/server/src/content-types/product-tag/index.js +7 -0
- package/server/src/content-types/product-tag/schema.json +38 -0
- package/server/src/content-types/product-variation/index.js +7 -0
- package/server/src/content-types/product-variation/schema.json +74 -0
- package/server/src/content-types/shipping-method/index.js +7 -0
- package/server/src/content-types/shipping-method/schema.json +91 -0
- package/server/src/content-types/shipping-rate/index.js +7 -0
- package/server/src/content-types/shipping-rate/schema.json +73 -0
- package/server/src/content-types/shipping-rule/index.js +7 -0
- package/server/src/content-types/shipping-rule/schema.json +84 -0
- package/server/src/content-types/shipping-zone/index.js +7 -0
- package/server/src/content-types/shipping-zone/schema.json +57 -0
- package/server/src/content-types/wishlist.js +66 -0
- package/server/src/controllers/address.js +374 -0
- package/server/src/controllers/auth.js +1409 -0
- package/server/src/controllers/cart.js +337 -0
- package/server/src/controllers/category.js +388 -0
- package/server/src/controllers/compare.js +246 -0
- package/server/src/controllers/controller.js +168 -0
- package/server/src/controllers/ecommerce.js +20 -0
- package/server/src/controllers/index.js +34 -0
- package/server/src/controllers/order.js +1100 -0
- package/server/src/controllers/payment.js +243 -0
- package/server/src/controllers/product.js +1006 -0
- package/server/src/controllers/productTag.js +370 -0
- package/server/src/controllers/productVariation.js +181 -0
- package/server/src/controllers/shipping.js +1046 -0
- package/server/src/controllers/wishlist.js +332 -0
- package/server/src/destroy.js +6 -0
- package/server/src/index.js +26 -0
- package/server/src/middlewares/index.js +4 -0
- package/server/src/policies/index.js +4 -0
- package/server/src/register.js +67 -0
- package/server/src/routes/index.js +1130 -0
- package/server/src/services/cart.js +531 -0
- package/server/src/services/compare.js +300 -0
- package/server/src/services/index.js +16 -0
- package/server/src/services/service.js +19 -0
- package/server/src/services/shipping.js +513 -0
- package/server/src/services/wishlist.js +238 -0
- package/server/src/utils/check-ecommerce-permission.js +204 -0
- package/server/src/utils/extend-user-schema.js +161 -0
- package/server/src/utils/seed-data.js +639 -0
- package/server/src/utils/send-email.js +98 -0
- package/strapi-server.js +1 -6
- package/dist/_chunks/Settings-Bg2JyQ4c.js +0 -31518
- package/dist/_chunks/Settings-BonPzbwr.mjs +0 -31499
- package/dist/_chunks/en-DE15m4xZ.mjs +0 -574
- package/dist/_chunks/index-BWVy9o1d.mjs +0 -128
- package/dist/_chunks/index-NRuOdjd7.js +0 -127
- package/dist/admin/index.js +0 -3
- package/dist/admin/index.mjs +0 -4
- package/dist/robots.txt +0 -3
- package/dist/server/index.js +0 -27336
- package/dist/uploads/.gitkeep +0 -0
- package/dist/uploads/accessories_category_2a5631094b.jpeg +0 -0
- package/dist/uploads/beauty_personal_care_category_57f8a8f1e3.jpeg +0 -0
- package/dist/uploads/books_category_a9a253eada.jpeg +0 -0
- package/dist/uploads/classic_cotton_tshirt_1_cd713425f6.png +0 -0
- package/dist/uploads/clothing_category_d5c60ef07b.jpeg +0 -0
- package/dist/uploads/daviddoe_strapi_adbcd41787.jpeg +0 -0
- package/dist/uploads/electronics_category_fc3e5ef571.jpeg +0 -0
- package/dist/uploads/ergonomic_office_chair_1_c751cffb07.png +0 -0
- package/dist/uploads/home_garden_category_4f6eb3f8d6.jpeg +0 -0
- package/dist/uploads/istockphoto_1188462138_612x612_11f295b9c0.jpg +0 -0
- package/dist/uploads/istockphoto_1188462138_612x612_396fb272fd.jpg +0 -0
- package/dist/uploads/large_daviddoe_strapi_adbcd41787.jpeg +0 -0
- package/dist/uploads/leather_travel_backpack_1_238bc1ae4d.png +0 -0
- package/dist/uploads/mechanical_keyboard_pro_1_0cd391a6ac.png +0 -0
- package/dist/uploads/medium_classic_cotton_tshirt_1_cd713425f6.png +0 -0
- package/dist/uploads/medium_daviddoe_strapi_adbcd41787.jpeg +0 -0
- package/dist/uploads/medium_ergonomic_office_chair_1_c751cffb07.png +0 -0
- package/dist/uploads/medium_leather_travel_backpack_1_238bc1ae4d.png +0 -0
- package/dist/uploads/medium_mechanical_keyboard_pro_1_0cd391a6ac.png +0 -0
- package/dist/uploads/medium_smart_watch_series_5_1_cdc2511fb7.png +0 -0
- package/dist/uploads/medium_smartphone_x_pro_1_c3f0cbd080.png +0 -0
- package/dist/uploads/medium_the_great_gatsby_special_1_2e7c76d997.png +0 -0
- package/dist/uploads/medium_wireless_headphones_1_fa75cd50c3.png +0 -0
- package/dist/uploads/medium_yoga_mat_premium_1_01f9a3b5fa.png +0 -0
- package/dist/uploads/predictive_maintenance_icons_industry_automation_600nw_2685943461_e18a8aa3b0.webp +0 -0
- package/dist/uploads/small_classic_cotton_tshirt_1_cd713425f6.png +0 -0
- package/dist/uploads/small_daviddoe_strapi_adbcd41787.jpeg +0 -0
- package/dist/uploads/small_ergonomic_office_chair_1_c751cffb07.png +0 -0
- package/dist/uploads/small_leather_travel_backpack_1_238bc1ae4d.png +0 -0
- package/dist/uploads/small_mechanical_keyboard_pro_1_0cd391a6ac.png +0 -0
- package/dist/uploads/small_smart_watch_series_5_1_cdc2511fb7.png +0 -0
- package/dist/uploads/small_smartphone_x_pro_1_c3f0cbd080.png +0 -0
- package/dist/uploads/small_the_great_gatsby_special_1_2e7c76d997.png +0 -0
- package/dist/uploads/small_wireless_headphones_1_fa75cd50c3.png +0 -0
- package/dist/uploads/small_yoga_mat_premium_1_01f9a3b5fa.png +0 -0
- package/dist/uploads/smart_watch_series_5_1_cdc2511fb7.png +0 -0
- package/dist/uploads/smartphone_x_pro_1_c3f0cbd080.png +0 -0
- package/dist/uploads/the_great_gatsby_special_1_2e7c76d997.png +0 -0
- package/dist/uploads/thumbnail_accessories_category_2a5631094b.jpeg +0 -0
- package/dist/uploads/thumbnail_beauty_personal_care_category_57f8a8f1e3.jpeg +0 -0
- package/dist/uploads/thumbnail_books_category_a9a253eada.jpeg +0 -0
- package/dist/uploads/thumbnail_classic_cotton_tshirt_1_cd713425f6.png +0 -0
- package/dist/uploads/thumbnail_clothing_category_d5c60ef07b.jpeg +0 -0
- package/dist/uploads/thumbnail_daviddoe_strapi_adbcd41787.jpeg +0 -0
- package/dist/uploads/thumbnail_electronics_category_fc3e5ef571.jpeg +0 -0
- package/dist/uploads/thumbnail_ergonomic_office_chair_1_c751cffb07.png +0 -0
- package/dist/uploads/thumbnail_home_garden_category_4f6eb3f8d6.jpeg +0 -0
- package/dist/uploads/thumbnail_istockphoto_1188462138_612x612_11f295b9c0.jpg +0 -0
- package/dist/uploads/thumbnail_istockphoto_1188462138_612x612_396fb272fd.jpg +0 -0
- package/dist/uploads/thumbnail_leather_travel_backpack_1_238bc1ae4d.png +0 -0
- package/dist/uploads/thumbnail_mechanical_keyboard_pro_1_0cd391a6ac.png +0 -0
- package/dist/uploads/thumbnail_predictive_maintenance_icons_industry_automation_600nw_2685943461_e18a8aa3b0.webp +0 -0
- package/dist/uploads/thumbnail_smart_watch_series_5_1_cdc2511fb7.png +0 -0
- package/dist/uploads/thumbnail_smartphone_x_pro_1_c3f0cbd080.png +0 -0
- package/dist/uploads/thumbnail_the_great_gatsby_special_1_2e7c76d997.png +0 -0
- package/dist/uploads/thumbnail_wireless_headphones_1_fa75cd50c3.png +0 -0
- package/dist/uploads/thumbnail_yoga_mat_premium_1_01f9a3b5fa.png +0 -0
- package/dist/uploads/webby-commerce.png +0 -0
- package/dist/uploads/wireless_headphones_1_fa75cd50c3.png +0 -0
- package/dist/uploads/yoga_mat_premium_1_01f9a3b5fa.png +0 -0
- /package/{dist → server/src}/data/demo-data.json +0 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { useIntl } from 'react-intl';
|
|
5
|
+
import { Box, Flex, Typography } from '@strapi/design-system';
|
|
6
|
+
|
|
7
|
+
import { PLUGIN_ID } from '../pluginId';
|
|
8
|
+
|
|
9
|
+
const ApiCollections = () => {
|
|
10
|
+
const { formatMessage } = useIntl();
|
|
11
|
+
|
|
12
|
+
const title = formatMessage({
|
|
13
|
+
id: `${PLUGIN_ID}.settings.apiCollections.title`,
|
|
14
|
+
defaultMessage: 'API Collections',
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const description = formatMessage({
|
|
18
|
+
id: `${PLUGIN_ID}.settings.apiCollections.description`,
|
|
19
|
+
defaultMessage:
|
|
20
|
+
'Reference for the public endpoints exposed by the Strapi Advanced Ecommerce plugin.',
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<Box padding={6}>
|
|
25
|
+
<Typography variant="alpha" textColor="neutral800">
|
|
26
|
+
{title}
|
|
27
|
+
</Typography>
|
|
28
|
+
|
|
29
|
+
<Box
|
|
30
|
+
background="neutral0"
|
|
31
|
+
padding={6}
|
|
32
|
+
shadow="filterShadow"
|
|
33
|
+
hasRadius
|
|
34
|
+
marginTop={4}
|
|
35
|
+
>
|
|
36
|
+
<Typography variant="epsilon" textColor="neutral800">
|
|
37
|
+
{description}
|
|
38
|
+
</Typography>
|
|
39
|
+
|
|
40
|
+
<Box marginTop={6}>
|
|
41
|
+
<Typography variant="delta" textColor="neutral800">
|
|
42
|
+
{formatMessage({
|
|
43
|
+
id: `${PLUGIN_ID}.settings.apiCollections.health.title`,
|
|
44
|
+
defaultMessage: 'Health Check',
|
|
45
|
+
})}
|
|
46
|
+
</Typography>
|
|
47
|
+
|
|
48
|
+
<Box marginTop={2}>
|
|
49
|
+
<Typography variant="pi" textColor="neutral600">
|
|
50
|
+
{formatMessage({
|
|
51
|
+
id: `${PLUGIN_ID}.settings.apiCollections.health.summary`,
|
|
52
|
+
defaultMessage:
|
|
53
|
+
'Simple endpoint to verify that the ecommerce plugin is installed and running.',
|
|
54
|
+
})}
|
|
55
|
+
</Typography>
|
|
56
|
+
</Box>
|
|
57
|
+
|
|
58
|
+
<Box marginTop={4}>
|
|
59
|
+
<Flex gap={3} direction="column" alignItems="flex-start">
|
|
60
|
+
<Box>
|
|
61
|
+
<Typography variant="pi" fontWeight="bold">
|
|
62
|
+
GET
|
|
63
|
+
</Typography>{' '}
|
|
64
|
+
<Typography variant="pi" textColor="neutral800">
|
|
65
|
+
/webbycommerce/health
|
|
66
|
+
</Typography>
|
|
67
|
+
</Box>
|
|
68
|
+
|
|
69
|
+
<Typography variant="pi" textColor="neutral600">
|
|
70
|
+
{formatMessage({
|
|
71
|
+
id: `${PLUGIN_ID}.settings.apiCollections.health.auth`,
|
|
72
|
+
defaultMessage: 'Auth: public (no authentication required by default).',
|
|
73
|
+
})}
|
|
74
|
+
</Typography>
|
|
75
|
+
|
|
76
|
+
<Box>
|
|
77
|
+
<Typography variant="pi" textColor="neutral800" fontWeight="bold">
|
|
78
|
+
{formatMessage({
|
|
79
|
+
id: `${PLUGIN_ID}.settings.apiCollections.health.response.title`,
|
|
80
|
+
defaultMessage: 'Successful response (200 OK)',
|
|
81
|
+
})}
|
|
82
|
+
</Typography>
|
|
83
|
+
<Box
|
|
84
|
+
marginTop={2}
|
|
85
|
+
padding={4}
|
|
86
|
+
background="neutral100"
|
|
87
|
+
hasRadius
|
|
88
|
+
style={{ fontFamily: 'monospace', fontSize: '12px' }}
|
|
89
|
+
>
|
|
90
|
+
{`{
|
|
91
|
+
"status": "ok",
|
|
92
|
+
"plugin": "webbycommerce",
|
|
93
|
+
"message": "Ecommerce plugin is running"
|
|
94
|
+
}`}
|
|
95
|
+
</Box>
|
|
96
|
+
</Box>
|
|
97
|
+
|
|
98
|
+
<Box marginTop={2}>
|
|
99
|
+
<Typography variant="pi" textColor="neutral800" fontWeight="bold">
|
|
100
|
+
{formatMessage({
|
|
101
|
+
id: `${PLUGIN_ID}.settings.apiCollections.health.usage.title`,
|
|
102
|
+
defaultMessage: 'Typical usage',
|
|
103
|
+
})}
|
|
104
|
+
</Typography>
|
|
105
|
+
<Box as="ul" marginTop={1} paddingLeft={4}>
|
|
106
|
+
<li>
|
|
107
|
+
<Typography variant="pi" textColor="neutral600">
|
|
108
|
+
{formatMessage({
|
|
109
|
+
id: `${PLUGIN_ID}.settings.apiCollections.health.usage.monitoring`,
|
|
110
|
+
defaultMessage: 'Use in uptime monitors to check ecommerce availability.',
|
|
111
|
+
})}
|
|
112
|
+
</Typography>
|
|
113
|
+
</li>
|
|
114
|
+
<li>
|
|
115
|
+
<Typography variant="pi" textColor="neutral600">
|
|
116
|
+
{formatMessage({
|
|
117
|
+
id: `${PLUGIN_ID}.settings.apiCollections.health.usage.deploy`,
|
|
118
|
+
defaultMessage:
|
|
119
|
+
'Use in deployment or CI pipelines to validate the plugin is bootstrapped.',
|
|
120
|
+
})}
|
|
121
|
+
</Typography>
|
|
122
|
+
</li>
|
|
123
|
+
<li>
|
|
124
|
+
<Typography variant="pi" textColor="neutral600">
|
|
125
|
+
{formatMessage({
|
|
126
|
+
id: `${PLUGIN_ID}.settings.apiCollections.health.usage.manual`,
|
|
127
|
+
defaultMessage:
|
|
128
|
+
'Quick manual verification from a browser or API client (Postman, Insomnia, curl).',
|
|
129
|
+
})}
|
|
130
|
+
</Typography>
|
|
131
|
+
</li>
|
|
132
|
+
</Box>
|
|
133
|
+
</Box>
|
|
134
|
+
|
|
135
|
+
<Box marginTop={2}>
|
|
136
|
+
<Typography variant="pi" textColor="neutral800" fontWeight="bold">
|
|
137
|
+
curl
|
|
138
|
+
</Typography>
|
|
139
|
+
<Box
|
|
140
|
+
marginTop={2}
|
|
141
|
+
padding={4}
|
|
142
|
+
background="neutral100"
|
|
143
|
+
hasRadius
|
|
144
|
+
style={{ fontFamily: 'monospace', fontSize: '12px' }}
|
|
145
|
+
>
|
|
146
|
+
{`curl http://localhost:1337/webbycommerce/health`}
|
|
147
|
+
</Box>
|
|
148
|
+
</Box>
|
|
149
|
+
</Flex>
|
|
150
|
+
</Box>
|
|
151
|
+
|
|
152
|
+
<Box marginTop={8}>
|
|
153
|
+
<Typography variant="pi" textColor="neutral500">
|
|
154
|
+
{formatMessage({
|
|
155
|
+
id: `${PLUGIN_ID}.settings.apiCollections.footer`,
|
|
156
|
+
defaultMessage:
|
|
157
|
+
'As you add more ecommerce endpoints (products, cart, orders, etc.), they can be documented here for your team.',
|
|
158
|
+
})}
|
|
159
|
+
</Typography>
|
|
160
|
+
</Box>
|
|
161
|
+
</Box>
|
|
162
|
+
</Box>
|
|
163
|
+
</Box>
|
|
164
|
+
);
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export default ApiCollections;
|
|
168
|
+
|
|
169
|
+
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { useIntl } from 'react-intl';
|
|
5
|
+
import { Box, Flex, Typography } from '@strapi/design-system';
|
|
6
|
+
|
|
7
|
+
import { PLUGIN_ID } from '../pluginId';
|
|
8
|
+
|
|
9
|
+
const Configure = () => {
|
|
10
|
+
const { formatMessage } = useIntl();
|
|
11
|
+
|
|
12
|
+
const title = formatMessage({
|
|
13
|
+
id: `${PLUGIN_ID}.settings.configure.title`,
|
|
14
|
+
defaultMessage: 'Configure',
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const description = formatMessage({
|
|
18
|
+
id: `${PLUGIN_ID}.settings.configure.description`,
|
|
19
|
+
defaultMessage:
|
|
20
|
+
'Global settings for the Strapi Advanced Ecommerce plugin. Use this page to control ecommerce-wide behavior.',
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<Box padding={6}>
|
|
25
|
+
<Typography variant="alpha" textColor="neutral800">
|
|
26
|
+
{formatMessage({
|
|
27
|
+
id: `${PLUGIN_ID}.settings.section`,
|
|
28
|
+
defaultMessage: 'Advanced Ecommerce',
|
|
29
|
+
})}
|
|
30
|
+
</Typography>
|
|
31
|
+
|
|
32
|
+
<Box
|
|
33
|
+
background="neutral0"
|
|
34
|
+
padding={6}
|
|
35
|
+
shadow="filterShadow"
|
|
36
|
+
hasRadius
|
|
37
|
+
marginTop={4}
|
|
38
|
+
>
|
|
39
|
+
<Typography variant="beta" textColor="neutral800">
|
|
40
|
+
{title}
|
|
41
|
+
</Typography>
|
|
42
|
+
|
|
43
|
+
<Box marginTop={2}>
|
|
44
|
+
<Typography variant="pi" textColor="neutral600">
|
|
45
|
+
{description}
|
|
46
|
+
</Typography>
|
|
47
|
+
</Box>
|
|
48
|
+
</Box>
|
|
49
|
+
</Box>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export default Configure;
|
|
54
|
+
|
|
55
|
+
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import { useIntl } from 'react-intl';
|
|
5
|
+
import { Main, Box, Flex, Typography, Button } from '@strapi/design-system';
|
|
6
|
+
|
|
7
|
+
import { PLUGIN_ID } from '../pluginId';
|
|
8
|
+
import ConfigureContent from '../components/ConfigureContent';
|
|
9
|
+
import ApiCollectionsContent from '../components/ApiCollectionsContent';
|
|
10
|
+
import LoginRegisterContent from '../components/LoginRegisterContent';
|
|
11
|
+
import ShippingTypeContent from '../components/ShippingTypeContent';
|
|
12
|
+
import SmtpContent from '../components/SmtpContent';
|
|
13
|
+
|
|
14
|
+
const Settings = () => {
|
|
15
|
+
const { formatMessage } = useIntl();
|
|
16
|
+
const [activeView, setActiveView] = useState('configure');
|
|
17
|
+
|
|
18
|
+
const titleId = `${PLUGIN_ID}-settings-title`;
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Main labelledBy={titleId}>
|
|
22
|
+
<Box padding={8} background="neutral100">
|
|
23
|
+
<Box paddingBottom={4}>
|
|
24
|
+
<Typography id={titleId} variant="alpha" as="h1">
|
|
25
|
+
{formatMessage({
|
|
26
|
+
id: `${PLUGIN_ID}.settings.section`,
|
|
27
|
+
defaultMessage: 'Advanced Ecommerce',
|
|
28
|
+
})}
|
|
29
|
+
</Typography>
|
|
30
|
+
</Box>
|
|
31
|
+
|
|
32
|
+
<Box background="neutral0" padding={6} shadow="filterShadow" hasRadius>
|
|
33
|
+
<Flex gap={2} marginBottom={6} wrap="wrap">
|
|
34
|
+
<Button
|
|
35
|
+
variant={activeView === 'configure' ? 'default' : 'tertiary'}
|
|
36
|
+
onClick={() => setActiveView('configure')}
|
|
37
|
+
>
|
|
38
|
+
{formatMessage({
|
|
39
|
+
id: `${PLUGIN_ID}.settings.configure.title`,
|
|
40
|
+
defaultMessage: 'Configure',
|
|
41
|
+
})}
|
|
42
|
+
</Button>
|
|
43
|
+
<Button
|
|
44
|
+
variant={activeView === 'login-register' ? 'default' : 'tertiary'}
|
|
45
|
+
onClick={() => setActiveView('login-register')}
|
|
46
|
+
>
|
|
47
|
+
{formatMessage({
|
|
48
|
+
id: `${PLUGIN_ID}.settings.loginRegister.title`,
|
|
49
|
+
defaultMessage: 'Login/Register',
|
|
50
|
+
})}
|
|
51
|
+
</Button>
|
|
52
|
+
<Button
|
|
53
|
+
variant={activeView === 'shipping-type' ? 'default' : 'tertiary'}
|
|
54
|
+
onClick={() => setActiveView('shipping-type')}
|
|
55
|
+
>
|
|
56
|
+
{formatMessage({
|
|
57
|
+
id: `${PLUGIN_ID}.settings.shippingType.title`,
|
|
58
|
+
defaultMessage: 'Shipping Type',
|
|
59
|
+
})}
|
|
60
|
+
</Button>
|
|
61
|
+
<Button
|
|
62
|
+
variant={activeView === 'smtp' ? 'default' : 'tertiary'}
|
|
63
|
+
onClick={() => setActiveView('smtp')}
|
|
64
|
+
>
|
|
65
|
+
{formatMessage({
|
|
66
|
+
id: `${PLUGIN_ID}.settings.smtp.title`,
|
|
67
|
+
defaultMessage: 'SMTP',
|
|
68
|
+
})}
|
|
69
|
+
</Button>
|
|
70
|
+
<Button
|
|
71
|
+
variant={activeView === 'api-collections' ? 'default' : 'tertiary'}
|
|
72
|
+
onClick={() => setActiveView('api-collections')}
|
|
73
|
+
>
|
|
74
|
+
{formatMessage({
|
|
75
|
+
id: `${PLUGIN_ID}.settings.apiCollections.title`,
|
|
76
|
+
defaultMessage: 'API Collections',
|
|
77
|
+
})}
|
|
78
|
+
</Button>
|
|
79
|
+
</Flex>
|
|
80
|
+
|
|
81
|
+
{activeView === 'configure' && <ConfigureContent />}
|
|
82
|
+
{activeView === 'login-register' && <LoginRegisterContent />}
|
|
83
|
+
{activeView === 'shipping-type' && <ShippingTypeContent />}
|
|
84
|
+
{activeView === 'smtp' && <SmtpContent />}
|
|
85
|
+
{activeView === 'api-collections' && <ApiCollectionsContent />}
|
|
86
|
+
</Box>
|
|
87
|
+
</Box>
|
|
88
|
+
</Main>
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export default Settings;
|
|
93
|
+
|