@geowiki/cms 0.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/LICENSE +201 -0
- package/README.md +55 -0
- package/dist/BannerFollowLinksWidget-26TXCSTL.mjs +21 -0
- package/dist/CardGridWidget-VZIU6X63.mjs +7 -0
- package/dist/CardWidget-7UX7ACLE.mjs +7 -0
- package/dist/ColumnWidget-XEDFONE6.mjs +7 -0
- package/dist/ContactCardsWidget-KRR6IY4X.mjs +95 -0
- package/dist/ContactWidget-WJH7K4FN.mjs +7 -0
- package/dist/ContainerWidget-N5TYK7XV.mjs +8 -0
- package/dist/DownloadQuestWidget-EVKBU33Z.mjs +86 -0
- package/dist/EntityListWidget-6N4AXYWX.mjs +7 -0
- package/dist/FarmerClusterFinderWidget-YENEGEZN.mjs +7 -0
- package/dist/FeatureRowWidget-YXCRZBKZ.mjs +7 -0
- package/dist/FeatureRowWithImageWidget-RDAGTLCL.mjs +7 -0
- package/dist/FeatureRowWithMultipleImagesWidget-NWLWBI3L.mjs +7 -0
- package/dist/GalleryWidget-7A3FR3Y7.mjs +7 -0
- package/dist/H2BodyInternalLinkMapWidget-6VQYSAGG.mjs +78 -0
- package/dist/HeaderBodyWidget-ZW2WYKNP.mjs +27 -0
- package/dist/HeaderWidget-DUNY7APY.mjs +7 -0
- package/dist/HeadingTextWidget-YC36BLDY.mjs +6 -0
- package/dist/HeroCenterTextWidget-5LDZNUBR.mjs +7 -0
- package/dist/HeroMap-RMHVOY4J.mjs +116 -0
- package/dist/HeroWidget-A4ODJCXZ.mjs +7 -0
- package/dist/IframeWidget-DPA25ZE2.mjs +17 -0
- package/dist/ImageLeftH3BodyLinkWidget-JMALBJVD.mjs +26 -0
- package/dist/ImageLefttH3BodyWidget-2YAEQZHJ.mjs +26 -0
- package/dist/ImageWidget-JWDKESIB.mjs +7 -0
- package/dist/LanguagesWidget-KWCLJBRT.mjs +61 -0
- package/dist/MapHeroWidget-I5SP4J5M.mjs +7 -0
- package/dist/MarkdownWidget-QTTNNVQW.mjs +7 -0
- package/dist/NewContactUsWidget-R5TILYPP.mjs +237 -0
- package/dist/NewTestimonialsWidget-CVFZM2UI.mjs +17 -0
- package/dist/NewfeedPreviewWidget-VM6ZMYGO.mjs +25 -0
- package/dist/NewsFeedWidget-BQTZYA6U.mjs +22 -0
- package/dist/NewsLetterWidget-AFK476TF.mjs +7 -0
- package/dist/QuestMapClient-5IEELSN6.mjs +119 -0
- package/dist/QuestMapWidget-5234C7VP.mjs +22 -0
- package/dist/ResourceCollectionItemWidget-QXAJEPCN.mjs +7 -0
- package/dist/ResourceCollectionsWidget-KZ5HD3PG.mjs +8 -0
- package/dist/ResourceQuickFindWidget-S3OJV3GF.mjs +9 -0
- package/dist/RowWidget-VSVZUIYH.mjs +7 -0
- package/dist/SelectQuestWidget-YGZ5TFLV.mjs +161 -0
- package/dist/SignUpBannerWidget-R77S5VSL.mjs +27 -0
- package/dist/SimpleActionListWidget-NF32S56W.mjs +7 -0
- package/dist/SimpleCallToActionWidget-3LI6HMJR.mjs +7 -0
- package/dist/SixClusterNewsWidget-5DDHGLAI.mjs +11 -0
- package/dist/SpecialFeaturesWidget-ZWILQPVB.mjs +7 -0
- package/dist/StatsWidget-4MISF6XB.mjs +7 -0
- package/dist/SubtitleH2BodyVideoWidget-CP7T4FJ6.mjs +24 -0
- package/dist/SubtitleH3BodyInternalLinkListWidget-CWKRJY4Z.mjs +25 -0
- package/dist/SubtitleH3BodySpecialFeatureResourceCollectionsWidget-62SJ4J73.mjs +37 -0
- package/dist/SubtitleH3BodyWidget-7XGVXSMR.mjs +35 -0
- package/dist/SubtitleH3ChildrenWidget-CA3TR726.mjs +40 -0
- package/dist/SubtitleH3FaqWidget-VXVV7TUL.mjs +78 -0
- package/dist/SubtitleH3KeyResourcesWidget-AGBBJ7ZJ.mjs +24 -0
- package/dist/SubtitleH3ResourceCollectionsWidget-IBDVHMSC.mjs +37 -0
- package/dist/TestimonialListWidget-5OKZ5TQQ.mjs +7 -0
- package/dist/UpdateUserInfoWidget-4I6RJQ5M.mjs +7 -0
- package/dist/UserInfoWidget-AS53SE7B.mjs +7 -0
- package/dist/VideoWidget-E72DF4FB.mjs +18 -0
- package/dist/chunk-43BPHKG6.mjs +348 -0
- package/dist/chunk-AO6SFQGL.mjs +20 -0
- package/dist/chunk-AQKMITUZ.mjs +52 -0
- package/dist/chunk-DMKIIBTI.mjs +11 -0
- package/dist/chunk-ECRLCFXK.mjs +65 -0
- package/dist/chunk-ER4KI2WR.mjs +24 -0
- package/dist/chunk-FQ57AT5X.mjs +51 -0
- package/dist/chunk-J7SY757T.mjs +44 -0
- package/dist/chunk-JJWETKAK.mjs +18 -0
- package/dist/chunk-JNVPTKNZ.mjs +20 -0
- package/dist/chunk-KR42WXX4.mjs +18 -0
- package/dist/chunk-LIPPN7U2.mjs +25 -0
- package/dist/chunk-MR3ABJDZ.mjs +30 -0
- package/dist/chunk-O6WFR4J5.mjs +10 -0
- package/dist/chunk-OCSKL7XJ.mjs +34 -0
- package/dist/chunk-PTPZAQH2.mjs +85 -0
- package/dist/chunk-PXKRTTW7.mjs +20 -0
- package/dist/chunk-QDEIIXMC.mjs +52 -0
- package/dist/chunk-QYIHQTW5.mjs +46 -0
- package/dist/chunk-RXVHS4OJ.mjs +24 -0
- package/dist/chunk-SNHJDG24.mjs +44 -0
- package/dist/chunk-UGGGP7ZA.mjs +166 -0
- package/dist/chunk-UGPLOPUH.mjs +129 -0
- package/dist/chunk-UYS3OVMP.mjs +9 -0
- package/dist/chunk-VFXOGW3A.mjs +10 -0
- package/dist/chunk-VFYJ2I2X.mjs +45 -0
- package/dist/chunk-VHLUUHQ3.mjs +43 -0
- package/dist/chunk-VKH6K2KB.mjs +33 -0
- package/dist/chunk-XF76SGFU.mjs +10 -0
- package/dist/chunk-XR7AIYAA.mjs +112 -0
- package/dist/chunk-ZX5FKJYJ.mjs +28 -0
- package/dist/html-section-CWKFJCXX.mjs +7 -0
- package/dist/index.d.mts +192 -0
- package/dist/index.d.ts +192 -0
- package/dist/index.js +3950 -0
- package/dist/index.mjs +334 -0
- package/dist/styles.css +1 -0
- package/package.json +79 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
// src/components/Section/ContactWidget.tsx
|
|
2
|
+
import { EmailManagementService } from "@geowiki/api-proxy";
|
|
3
|
+
import { useHosts, HostService } from "@geowiki/core";
|
|
4
|
+
import { useForm } from "react-hook-form";
|
|
5
|
+
import { toast } from "react-toastify";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
var ContactWidget = ({ data }) => {
|
|
8
|
+
const { data: hosts } = useHosts();
|
|
9
|
+
const {
|
|
10
|
+
register,
|
|
11
|
+
handleSubmit,
|
|
12
|
+
formState: { errors }
|
|
13
|
+
} = useForm();
|
|
14
|
+
const onSubmit = async (formData) => {
|
|
15
|
+
var tenantInfo = HostService.getCurrentHostInfo(hosts || []);
|
|
16
|
+
var tenantName = HostService.getTenantName(tenantInfo);
|
|
17
|
+
var subjectPrefix = "";
|
|
18
|
+
if (tenantName) {
|
|
19
|
+
subjectPrefix = tenantName + " - ";
|
|
20
|
+
}
|
|
21
|
+
var subject = subjectPrefix + "Contact form from - " + formData.first_name + " " + formData.last_name;
|
|
22
|
+
try {
|
|
23
|
+
await EmailManagementService.emailManagementSendEmail(
|
|
24
|
+
data?.Contact?.From?.Text,
|
|
25
|
+
data?.Contact?.To?.Text,
|
|
26
|
+
formData.from,
|
|
27
|
+
subject,
|
|
28
|
+
formData.message
|
|
29
|
+
);
|
|
30
|
+
toast.success("Email sent successfully!");
|
|
31
|
+
} catch (error) {
|
|
32
|
+
console.log(error);
|
|
33
|
+
toast.error("Failed to send email");
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ jsx("div", { className: "container mx-auto", children: /* @__PURE__ */ jsx("div", { className: "relative isolate py-24 px-6 sm:py-32 lg:px-8", children: /* @__PURE__ */ jsxs("div", { className: "mx-auto max-w-xl lg:max-w-4xl", children: [
|
|
37
|
+
/* @__PURE__ */ jsx("h2", { className: "text-4xl font-bold tracking-tight", children: data.Contact?.MainText?.Text }),
|
|
38
|
+
/* @__PURE__ */ jsx("p", { className: "mt-2 text-lg leading-8 ", children: data.Contact?.SubText?.Text }),
|
|
39
|
+
/* @__PURE__ */ jsx("div", { className: "mt-16 flex flex-col gap-16 sm:gap-y-20 lg:flex-row", children: /* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit(onSubmit), className: "lg:flex-auto", children: [
|
|
40
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
|
|
41
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
42
|
+
/* @__PURE__ */ jsxs(
|
|
43
|
+
"label",
|
|
44
|
+
{
|
|
45
|
+
htmlFor: "from",
|
|
46
|
+
className: "block text-sm font-semibold leading-6 ",
|
|
47
|
+
children: [
|
|
48
|
+
"Your email address ",
|
|
49
|
+
/* @__PURE__ */ jsx("span", { className: "text-red-500", children: "*" })
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ jsx("div", { className: "mt-2.5", children: /* @__PURE__ */ jsx(
|
|
54
|
+
"input",
|
|
55
|
+
{
|
|
56
|
+
type: "email",
|
|
57
|
+
id: "from",
|
|
58
|
+
autoComplete: "email",
|
|
59
|
+
...register("from", { required: true }),
|
|
60
|
+
className: "block w-full rounded-md border-0 py-2 px-3.5 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6"
|
|
61
|
+
}
|
|
62
|
+
) }),
|
|
63
|
+
errors.from && /* @__PURE__ */ jsx("span", { className: "text-red-500", children: "Email is required" })
|
|
64
|
+
] }),
|
|
65
|
+
/* @__PURE__ */ jsxs("div", { className: "pt-4", children: [
|
|
66
|
+
/* @__PURE__ */ jsxs(
|
|
67
|
+
"label",
|
|
68
|
+
{
|
|
69
|
+
htmlFor: "first_name",
|
|
70
|
+
className: "block text-sm font-semibold leading-6 ",
|
|
71
|
+
children: [
|
|
72
|
+
"First name ",
|
|
73
|
+
/* @__PURE__ */ jsx("span", { className: "text-red-500", children: "*" })
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
),
|
|
77
|
+
/* @__PURE__ */ jsx("div", { className: "mt-2.5", children: /* @__PURE__ */ jsx(
|
|
78
|
+
"input",
|
|
79
|
+
{
|
|
80
|
+
id: "first_name",
|
|
81
|
+
autoComplete: "first_name",
|
|
82
|
+
...register("first_name", { required: true }),
|
|
83
|
+
className: "block w-full rounded-md border-0 py-2 px-3.5 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6"
|
|
84
|
+
}
|
|
85
|
+
) }),
|
|
86
|
+
errors.from && /* @__PURE__ */ jsxs("span", { className: "text-red-500", children: [
|
|
87
|
+
" ",
|
|
88
|
+
"First name is required"
|
|
89
|
+
] }),
|
|
90
|
+
/* @__PURE__ */ jsxs("div", { className: "pt-4", children: [
|
|
91
|
+
/* @__PURE__ */ jsxs(
|
|
92
|
+
"label",
|
|
93
|
+
{
|
|
94
|
+
htmlFor: "last_name",
|
|
95
|
+
className: "block text-sm font-semibold leading-6 ",
|
|
96
|
+
children: [
|
|
97
|
+
"Last name ",
|
|
98
|
+
/* @__PURE__ */ jsx("span", { className: "text-red-500", children: "*" })
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
/* @__PURE__ */ jsx("div", { className: "mt-2.5", children: /* @__PURE__ */ jsx(
|
|
103
|
+
"input",
|
|
104
|
+
{
|
|
105
|
+
id: "last_name",
|
|
106
|
+
autoComplete: "last_name",
|
|
107
|
+
...register("last_name", { required: true }),
|
|
108
|
+
className: "block w-full rounded-md border-0 py-2 px-3.5 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6"
|
|
109
|
+
}
|
|
110
|
+
) }),
|
|
111
|
+
errors.from && /* @__PURE__ */ jsx("span", { className: "text-red-500", children: "Last name is required" })
|
|
112
|
+
] })
|
|
113
|
+
] }),
|
|
114
|
+
/* @__PURE__ */ jsxs("div", { className: "pt-4", children: [
|
|
115
|
+
/* @__PURE__ */ jsxs(
|
|
116
|
+
"label",
|
|
117
|
+
{
|
|
118
|
+
htmlFor: "message",
|
|
119
|
+
className: "block text-sm font-semibold leading-6 ",
|
|
120
|
+
children: [
|
|
121
|
+
"Message ",
|
|
122
|
+
/* @__PURE__ */ jsx("span", { className: "text-red-500", children: "*" })
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
/* @__PURE__ */ jsx("div", { className: "mt-2.5", children: /* @__PURE__ */ jsx(
|
|
127
|
+
"textarea",
|
|
128
|
+
{
|
|
129
|
+
id: "message",
|
|
130
|
+
...register("message", { required: true }),
|
|
131
|
+
rows: 4,
|
|
132
|
+
className: "block w-full rounded-md border-0 py-2 px-3.5 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6",
|
|
133
|
+
defaultValue: ""
|
|
134
|
+
}
|
|
135
|
+
) }),
|
|
136
|
+
errors.message && /* @__PURE__ */ jsx("span", { className: "text-red-500", children: "Message is required" })
|
|
137
|
+
] })
|
|
138
|
+
] }),
|
|
139
|
+
/* @__PURE__ */ jsx("div", { className: "mt-10", children: /* @__PURE__ */ jsx(
|
|
140
|
+
"button",
|
|
141
|
+
{
|
|
142
|
+
type: "submit",
|
|
143
|
+
className: "block w-full rounded-md bg-primary-600 px-3.5 py-2.5 text-center text-sm font-semibold text-white shadow-sm hover:bg-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600",
|
|
144
|
+
children: "Submit"
|
|
145
|
+
}
|
|
146
|
+
) }),
|
|
147
|
+
/* @__PURE__ */ jsxs("p", { className: "mt-4 text-sm leading-6", children: [
|
|
148
|
+
"By submitting this form, I agree to the",
|
|
149
|
+
" ",
|
|
150
|
+
/* @__PURE__ */ jsx(
|
|
151
|
+
"a",
|
|
152
|
+
{
|
|
153
|
+
href: data.Contact?.PrivacyUrl?.Text,
|
|
154
|
+
className: "font-semibold text-primary-600 cursor-pointer",
|
|
155
|
+
children: "Privacy\xA0Policy"
|
|
156
|
+
}
|
|
157
|
+
),
|
|
158
|
+
"."
|
|
159
|
+
] })
|
|
160
|
+
] }) })
|
|
161
|
+
] }) }) });
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
export {
|
|
165
|
+
ContactWidget
|
|
166
|
+
};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
// src/components/Section/NewsLetterWidget.tsx
|
|
2
|
+
import { OldButton } from "@geowiki/ui";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { OpenAPI } from "@geowiki/api-proxy";
|
|
5
|
+
import { useToast } from "@geowiki/ui";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
var NewsLetterWidget = ({ data }) => {
|
|
8
|
+
const { toast } = useToast();
|
|
9
|
+
const [loading, setLoading] = useState(false);
|
|
10
|
+
const [isAccepted, setIsAccepted] = useState(false);
|
|
11
|
+
const [email, setEmail] = useState("");
|
|
12
|
+
const isEmailValid = (email2) => {
|
|
13
|
+
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email2);
|
|
14
|
+
};
|
|
15
|
+
const subscribe = async () => {
|
|
16
|
+
if (!isAccepted) {
|
|
17
|
+
toast({
|
|
18
|
+
title: "You must accept the privacy policy",
|
|
19
|
+
variant: "destructive"
|
|
20
|
+
});
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (!email || email.length === 0) {
|
|
24
|
+
toast({ title: "You must enter an email", variant: "destructive" });
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (!isEmailValid(email)) {
|
|
28
|
+
toast({ title: "Invalid email", variant: "destructive" });
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
setLoading(true);
|
|
32
|
+
try {
|
|
33
|
+
const res = await fetch(`${OpenAPI.BASE}/api/newsletter/subscribe`, {
|
|
34
|
+
method: "POST",
|
|
35
|
+
headers: { "Content-Type": "application/json" },
|
|
36
|
+
body: JSON.stringify({ email })
|
|
37
|
+
});
|
|
38
|
+
if (!res.ok) {
|
|
39
|
+
let message = "Subscription failed. Please try again later.";
|
|
40
|
+
try {
|
|
41
|
+
const body = await res.json();
|
|
42
|
+
message = body?.error?.message ?? message;
|
|
43
|
+
} catch {
|
|
44
|
+
}
|
|
45
|
+
toast({ title: message, variant: "destructive" });
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const result = await res.json();
|
|
49
|
+
toast({
|
|
50
|
+
title: result?.requiresConfirmation ? "Almost there \u2014 please check your inbox to confirm your subscription." : "Subscribed successfully",
|
|
51
|
+
variant: "default"
|
|
52
|
+
});
|
|
53
|
+
setEmail("");
|
|
54
|
+
setIsAccepted(false);
|
|
55
|
+
} catch {
|
|
56
|
+
toast({
|
|
57
|
+
title: "Subscription failed. Please try again later.",
|
|
58
|
+
variant: "destructive"
|
|
59
|
+
});
|
|
60
|
+
} finally {
|
|
61
|
+
setLoading(false);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
return /* @__PURE__ */ jsx("div", { className: "border rounded-xl", children: /* @__PURE__ */ jsxs("div", { className: "container mx-auto py-12 px-4 sm:px-6 lg:py-16 lg:px-8 lg:flex lg:items-center", children: [
|
|
65
|
+
/* @__PURE__ */ jsxs("div", { className: "lg:w-0 lg:flex-1", children: [
|
|
66
|
+
/* @__PURE__ */ jsx(
|
|
67
|
+
"h2",
|
|
68
|
+
{
|
|
69
|
+
className: "text-3xl font-extrabold tracking-tight sm:text-4xl",
|
|
70
|
+
id: "newsletter-headline",
|
|
71
|
+
children: data?.NewsLetter?.MainText?.Text
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
/* @__PURE__ */ jsx("p", { className: "mt-3 max-w-3xl text-lg leading-6", children: data?.NewsLetter?.SubText?.Text })
|
|
75
|
+
] }),
|
|
76
|
+
/* @__PURE__ */ jsx("div", { className: "lg:mt-0 lg:ml-8 ", children: /* @__PURE__ */ jsxs("div", { children: [
|
|
77
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col md:flex-row gap-4 pt-8", children: [
|
|
78
|
+
/* @__PURE__ */ jsx(
|
|
79
|
+
"input",
|
|
80
|
+
{
|
|
81
|
+
className: "mt-1 bg-gray-100 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm",
|
|
82
|
+
type: "email",
|
|
83
|
+
name: "email",
|
|
84
|
+
value: email,
|
|
85
|
+
onChange: (e) => setEmail(e.target.value),
|
|
86
|
+
placeholder: data.emailPlaceholder
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
/* @__PURE__ */ jsx(
|
|
90
|
+
OldButton,
|
|
91
|
+
{
|
|
92
|
+
compact: false,
|
|
93
|
+
appearance: "dark",
|
|
94
|
+
label: "Subscribe",
|
|
95
|
+
handleClick: subscribe,
|
|
96
|
+
loading
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
] }),
|
|
100
|
+
/* @__PURE__ */ jsxs("p", { className: "mt-3 text-sm", children: [
|
|
101
|
+
/* @__PURE__ */ jsx(
|
|
102
|
+
"input",
|
|
103
|
+
{
|
|
104
|
+
type: "checkbox",
|
|
105
|
+
checked: isAccepted,
|
|
106
|
+
onChange: () => setIsAccepted(!isAccepted),
|
|
107
|
+
className: "mr-2",
|
|
108
|
+
name: "accept",
|
|
109
|
+
id: "accept"
|
|
110
|
+
}
|
|
111
|
+
),
|
|
112
|
+
"We care about the protection of your data. Read our",
|
|
113
|
+
" ",
|
|
114
|
+
/* @__PURE__ */ jsx(
|
|
115
|
+
"a",
|
|
116
|
+
{
|
|
117
|
+
href: data.NewsLetter?.PrivacyUrl?.Text || "#",
|
|
118
|
+
className: "font-medium underline cursor-pointer",
|
|
119
|
+
children: "Terms of Use."
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
] })
|
|
123
|
+
] }) })
|
|
124
|
+
] }) });
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export {
|
|
128
|
+
NewsLetterWidget
|
|
129
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// src/components/Section/MarkdownWidget.tsx
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
var MarkdownWidget = ({ data }) => {
|
|
4
|
+
return /* @__PURE__ */ jsx("div", { className: "mx-auto flex flex-col justify-center pt-4", children: /* @__PURE__ */ jsx("div", { className: "container mx-auto", children: data.MarkdownBodyPart?.Markdown }) });
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export {
|
|
8
|
+
MarkdownWidget
|
|
9
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// src/components/Section/Recodo/UserInfoWidget.tsx
|
|
2
|
+
import { UserInfoPage } from "@geowiki/recodo";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
var UserInfoWidget = (_props) => {
|
|
5
|
+
return /* @__PURE__ */ jsx("div", { className: "container mx-auto", children: /* @__PURE__ */ jsx(UserInfoPage, {}) });
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
UserInfoWidget
|
|
10
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// src/components/Section/RowWidget.tsx
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import { CustomLink } from "@geowiki/ui";
|
|
4
|
+
import { CmsImage } from "@geowiki/ui";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
var RowWidget = ({ data, cmsUrl }) => {
|
|
7
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
8
|
+
data.TitlePart && /* @__PURE__ */ jsx("section", { className: "py-12 text-center", children: /* @__PURE__ */ jsx("h2", { className: "text-4xl font-bold", children: data.TitlePart?.Title }) }),
|
|
9
|
+
/* @__PURE__ */ jsx("div", { className: "container mx-auto flex flex-col gap-12 py-12", children: data.BagPart?.ContentItems?.map((row, index) => /* @__PURE__ */ jsxs(
|
|
10
|
+
"div",
|
|
11
|
+
{
|
|
12
|
+
className: classNames(
|
|
13
|
+
"flex flex-col justify-start md:justify-between md:items-center gap-10",
|
|
14
|
+
{
|
|
15
|
+
"lg:flex-row": index % 2 === 0,
|
|
16
|
+
"lg:flex-row-reverse": index % 2 === 1
|
|
17
|
+
}
|
|
18
|
+
),
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ jsxs("div", { className: "w-full lg:w-6/12 lg:pr-6 text-lg", children: [
|
|
21
|
+
/* @__PURE__ */ jsx("h3", { className: "text-2xl font-bold text-center", children: row.Card?.MainText?.Text }),
|
|
22
|
+
/* @__PURE__ */ jsx("p", { className: "my-6", children: row.Card?.Description?.Text }),
|
|
23
|
+
/* @__PURE__ */ jsx(CustomLink, { data: row.LinkPart })
|
|
24
|
+
] }),
|
|
25
|
+
/* @__PURE__ */ jsx("div", { className: "w-full sm:9/12 lg:w-6/12 max-h-full", children: /* @__PURE__ */ jsx(
|
|
26
|
+
CmsImage,
|
|
27
|
+
{
|
|
28
|
+
className: "h-96",
|
|
29
|
+
src: row.Card?.Image?.Paths[0],
|
|
30
|
+
height: 384,
|
|
31
|
+
width: 900,
|
|
32
|
+
alt: row.Card?.MainText?.Text,
|
|
33
|
+
cmsUrl
|
|
34
|
+
}
|
|
35
|
+
) })
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
row.ContentItemId
|
|
39
|
+
)) })
|
|
40
|
+
] });
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
RowWidget
|
|
45
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// src/components/Section/FeatureRowWithMultipleImagesWidget.tsx
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
var FeatureRowWithMultipleImagesWidget = ({
|
|
4
|
+
data,
|
|
5
|
+
cmsUrl
|
|
6
|
+
}) => {
|
|
7
|
+
return /* @__PURE__ */ jsxs("div", { className: "container mx-auto px-4 py-16", children: [
|
|
8
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col mb-6", children: [
|
|
9
|
+
/* @__PURE__ */ jsxs("h2", { className: "max-w-lg mb-5 text-3xl font-bold tracking-tight sm:text-4xl sm:leading-none md:mb-6 group", children: [
|
|
10
|
+
/* @__PURE__ */ jsx("span", { className: "inline-block mb-1 sm:mb-4", children: data.FeatureRowWithMultipleImages?.MainText?.Text }),
|
|
11
|
+
/* @__PURE__ */ jsx("div", { className: "h-1 ml-auto duration-300 origin-left transform bg-deep-purple-accent-400 scale-x-30 group-hover:scale-x-100" })
|
|
12
|
+
] }),
|
|
13
|
+
/* @__PURE__ */ jsx("p", { className: "text-xl lg:max-w-md", children: data.FeatureRowWithMultipleImages?.SubText?.Text })
|
|
14
|
+
] }),
|
|
15
|
+
/* @__PURE__ */ jsx("div", { className: "grid gap-6 row-gap-5 mb-8 lg:grid-cols-4 sm:row-gap-6 sm:grid-cols-2", children: data?.Images?.ContentItems?.map(
|
|
16
|
+
(image, index) => {
|
|
17
|
+
return /* @__PURE__ */ jsx(
|
|
18
|
+
"a",
|
|
19
|
+
{
|
|
20
|
+
href: image?.ImageWithText?.LinkUrl?.Url,
|
|
21
|
+
"aria-label": "View Item",
|
|
22
|
+
children: /* @__PURE__ */ jsxs("div", { className: "relative overflow-hidden transition duration-200 transform rounded shadow-lg hover:-translate-y-2 hover:shadow-2xl", children: [
|
|
23
|
+
/* @__PURE__ */ jsx(
|
|
24
|
+
"img",
|
|
25
|
+
{
|
|
26
|
+
className: "object-cover w-full h-56 md:h-64 xl:h-80",
|
|
27
|
+
src: `${cmsUrl}/media/${image?.ImageWithText?.Image?.Paths?.[0]}?height=480&width=480`,
|
|
28
|
+
alt: ""
|
|
29
|
+
}
|
|
30
|
+
),
|
|
31
|
+
/* @__PURE__ */ jsx("div", { className: "absolute inset-x-0 bottom-0 px-6 py-4 bg-primary bg-opacity-75", children: /* @__PURE__ */ jsx("p", { className: "text-sm font-medium tracking-wide text-white", children: image?.ImageWithText?.Text?.Text }) })
|
|
32
|
+
] })
|
|
33
|
+
},
|
|
34
|
+
index
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
) })
|
|
38
|
+
] });
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
FeatureRowWithMultipleImagesWidget
|
|
43
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// src/components/Section/FeatureRowWithImageWidget.tsx
|
|
2
|
+
import { FeatureItemElement } from "@geowiki/ui";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
var FeatureRowWithImageWidget = ({
|
|
5
|
+
data,
|
|
6
|
+
cmsUrl
|
|
7
|
+
}) => {
|
|
8
|
+
return /* @__PURE__ */ jsx("div", { className: "container mx-auto px-4 py-4", children: /* @__PURE__ */ jsxs("div", { className: "grid gap-5 row-gap-8 lg:grid-cols-2", children: [
|
|
9
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col justify-center", children: [
|
|
10
|
+
/* @__PURE__ */ jsxs("div", { className: "max-w-xl mb-6", children: [
|
|
11
|
+
/* @__PURE__ */ jsx("h2", { className: "max-w-lg mb-6 text-3xl font-bold tracking-tight sm:text-4xl sm:leading-none", children: data.FeatureRowWithImage?.MainText?.Text }),
|
|
12
|
+
/* @__PURE__ */ jsx("p", { className: "text-base md:text-lg", children: data.FeatureRowWithImage?.SubText?.Text })
|
|
13
|
+
] }),
|
|
14
|
+
/* @__PURE__ */ jsx("div", { className: "grid gap-5 row-gap-8 sm:grid-cols-2", children: data.FeatureItems?.ContentItems?.map(
|
|
15
|
+
(item, index) => {
|
|
16
|
+
return /* @__PURE__ */ jsx(FeatureItemElement, { item, cmsUrl }, index);
|
|
17
|
+
}
|
|
18
|
+
) })
|
|
19
|
+
] }),
|
|
20
|
+
/* @__PURE__ */ jsx("div", { className: "flex justify-center items-center ", children: /* @__PURE__ */ jsx(
|
|
21
|
+
"img",
|
|
22
|
+
{
|
|
23
|
+
className: "object-cover w-full h-96 rounded shadow-lg",
|
|
24
|
+
alt: data.FeatureRowWithImage?.Image?.Description?.Text,
|
|
25
|
+
src: `${cmsUrl}/media/${data.FeatureRowWithImage?.Image?.Paths?.[0]}?height=480&width=480`
|
|
26
|
+
}
|
|
27
|
+
) })
|
|
28
|
+
] }) });
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
FeatureRowWithImageWidget
|
|
33
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// src/components/Section/Recodo/FarmerClusterFinderWidget.tsx
|
|
2
|
+
import { FarmerClusterFinder } from "@geowiki/recodo";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
var FarmerClusterFinderWidget = (_props) => {
|
|
5
|
+
return /* @__PURE__ */ jsx("div", { className: "lg:container mx-auto", children: /* @__PURE__ */ jsx(FarmerClusterFinder, {}) });
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
FarmerClusterFinderWidget
|
|
10
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// src/components/Section/HeroWidget.tsx
|
|
2
|
+
import { HeroImage } from "@geowiki/ui";
|
|
3
|
+
import { HeroWidgetOld } from "@geowiki/ui";
|
|
4
|
+
import { HeroWithCenterText } from "@geowiki/ui";
|
|
5
|
+
import { HeroWithMap } from "@geowiki/ui";
|
|
6
|
+
import { HeroWithMultipleImage } from "@geowiki/ui";
|
|
7
|
+
import { HeroWithThreeImage } from "@geowiki/ui";
|
|
8
|
+
import { useCmsUrl } from "@geowiki/core";
|
|
9
|
+
import { HeroImageLeft, HeroImageRight } from "@geowiki/ui";
|
|
10
|
+
import { HeroWidgetMobileDevice } from "@geowiki/ui";
|
|
11
|
+
import { jsx } from "react/jsx-runtime";
|
|
12
|
+
var HeroWidget = ({ data }) => {
|
|
13
|
+
const type = data?.Hero?.Type?.Text;
|
|
14
|
+
var cmsUrl = useCmsUrl();
|
|
15
|
+
switch (type) {
|
|
16
|
+
case "image":
|
|
17
|
+
return /* @__PURE__ */ jsx(HeroImage, { path: data?.Hero?.Images?.Paths[0], cmsUrl });
|
|
18
|
+
case "withMultipleImages":
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
HeroWithMultipleImage,
|
|
21
|
+
{
|
|
22
|
+
paths: data?.Hero?.Images?.Paths,
|
|
23
|
+
contentItemId: data.ContentItemId,
|
|
24
|
+
title: data.Hero?.Title?.Text,
|
|
25
|
+
description: data.Hero?.Description?.Text,
|
|
26
|
+
links: data.Buttons?.ContentItems,
|
|
27
|
+
cmsUrl
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
case "withThreeImages":
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
HeroWithThreeImage,
|
|
33
|
+
{
|
|
34
|
+
paths: data?.Hero?.Images?.Paths,
|
|
35
|
+
title: data?.Hero?.Title?.Text,
|
|
36
|
+
description: data?.Hero?.Description?.Text,
|
|
37
|
+
links: data?.Buttons?.ContentItems,
|
|
38
|
+
cmsUrl
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
case "withCenterText":
|
|
42
|
+
return /* @__PURE__ */ jsx(
|
|
43
|
+
HeroWithCenterText,
|
|
44
|
+
{
|
|
45
|
+
paths: data?.Hero?.Images?.Paths,
|
|
46
|
+
title: data.Hero?.Title?.Text,
|
|
47
|
+
description: data.Hero?.Description?.Text,
|
|
48
|
+
links: data.Buttons?.ContentItems,
|
|
49
|
+
cmsUrl
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
case "withMap":
|
|
53
|
+
return /* @__PURE__ */ jsx(
|
|
54
|
+
HeroWithMap,
|
|
55
|
+
{
|
|
56
|
+
title: data.Hero?.Title?.Text,
|
|
57
|
+
description: data.Hero?.Description?.Text,
|
|
58
|
+
links: data.Buttons?.ContentItems
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
case "withImageLeft":
|
|
62
|
+
return /* @__PURE__ */ jsx(
|
|
63
|
+
HeroImageLeft,
|
|
64
|
+
{
|
|
65
|
+
logoPath: data?.Hero?.Logo?.Paths[0],
|
|
66
|
+
path: data?.Hero?.Images?.Paths[0],
|
|
67
|
+
text: data.Hero?.Description?.Text
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
case "withImageRight":
|
|
71
|
+
return /* @__PURE__ */ jsx(
|
|
72
|
+
HeroImageRight,
|
|
73
|
+
{
|
|
74
|
+
path: data?.Hero?.Images?.Paths[0],
|
|
75
|
+
title: data.Hero?.Title?.Text,
|
|
76
|
+
description: data.Hero?.Description?.Text
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
case "mobileDevice":
|
|
80
|
+
return /* @__PURE__ */ jsx(
|
|
81
|
+
HeroWidgetMobileDevice,
|
|
82
|
+
{
|
|
83
|
+
version: data.Hero?.LayoutVersion.Value ?? 1,
|
|
84
|
+
title: data.Hero?.Title?.Text,
|
|
85
|
+
description: data.Hero?.Description?.Text,
|
|
86
|
+
image: data.Hero?.Images?.Paths?.[0],
|
|
87
|
+
cmsUrl,
|
|
88
|
+
links: data?.Buttons?.ContentItems,
|
|
89
|
+
storeLinks: [
|
|
90
|
+
...data.Hero?.GooglePlayUrl.Text ? [{ url: data.Hero.GooglePlayUrl.Text, type: "google" }] : [],
|
|
91
|
+
...data.Hero?.AppStoreUrl.Text ? [{ url: data.Hero.AppStoreUrl.Text, type: "apple" }] : []
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
default:
|
|
96
|
+
return /* @__PURE__ */ jsx(
|
|
97
|
+
HeroWidgetOld,
|
|
98
|
+
{
|
|
99
|
+
paths: data?.HeroWidget.Images?.Paths,
|
|
100
|
+
contentItemId: data.ContentItemId,
|
|
101
|
+
mainText: data.HeroWidget.MainText.Text,
|
|
102
|
+
subText: data.HeroWidget.SubText.Text,
|
|
103
|
+
contentItems: data?.Buttons?.ContentItems,
|
|
104
|
+
cmsUrl
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export {
|
|
111
|
+
HeroWidget
|
|
112
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// src/components/Section/MapHeroWidget.tsx
|
|
2
|
+
import { dynamic } from "@geowiki/core";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
var MapWithNoSSR = dynamic(
|
|
6
|
+
() => import("./HeroMap-RMHVOY4J.mjs").then((x) => x.HeroMap),
|
|
7
|
+
{
|
|
8
|
+
ssr: false
|
|
9
|
+
}
|
|
10
|
+
);
|
|
11
|
+
var MapHeroWidget = ({}) => {
|
|
12
|
+
const [position, setPosition] = useState(null);
|
|
13
|
+
return /* @__PURE__ */ jsx("div", { className: "w-full h-[560px] rounded-[12px] mt-6 overflow-hidden lg:mt-12", children: /* @__PURE__ */ jsx(
|
|
14
|
+
MapWithNoSSR,
|
|
15
|
+
{
|
|
16
|
+
...{
|
|
17
|
+
position,
|
|
18
|
+
setPosition,
|
|
19
|
+
showClusterMarkers: true,
|
|
20
|
+
enableLocationMarker: false
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
) });
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
MapHeroWidget
|
|
28
|
+
};
|