@graphprotocol/go 10.5.2
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/dist/AnnouncementBanner/AnnouncementBanner.d.ts +19 -0
- package/dist/AnnouncementBanner/AnnouncementBanner.d.ts.map +1 -0
- package/dist/AnnouncementBanner/AnnouncementBanner.js +116 -0
- package/dist/AnnouncementBanner/index.d.ts +2 -0
- package/dist/AnnouncementBanner/index.d.ts.map +1 -0
- package/dist/CookieBanner/CookieBanner.d.ts +17 -0
- package/dist/CookieBanner/CookieBanner.d.ts.map +1 -0
- package/dist/CookieBanner/CookieBanner.js +195 -0
- package/dist/CookieBanner/index.d.ts +2 -0
- package/dist/CookieBanner/index.d.ts.map +1 -0
- package/dist/FeaturedSubgraphs/FeaturedSubgraphsGrid.d.ts +4 -0
- package/dist/FeaturedSubgraphs/FeaturedSubgraphsGrid.d.ts.map +1 -0
- package/dist/FeaturedSubgraphs/FeaturedSubgraphsGrid.js +42 -0
- package/dist/FeaturedSubgraphs/generated/gql.d.ts +42 -0
- package/dist/FeaturedSubgraphs/generated/gql.d.ts.map +1 -0
- package/dist/FeaturedSubgraphs/generated/gql.js +11 -0
- package/dist/FeaturedSubgraphs/generated/graphql.d.ts +10835 -0
- package/dist/FeaturedSubgraphs/generated/graphql.d.ts.map +1 -0
- package/dist/FeaturedSubgraphs/generated/graphql.js +403 -0
- package/dist/FeaturedSubgraphs/generated/index.d.ts +2 -0
- package/dist/FeaturedSubgraphs/generated/index.d.ts.map +1 -0
- package/dist/FeaturedSubgraphs/index.d.ts +3 -0
- package/dist/FeaturedSubgraphs/index.d.ts.map +1 -0
- package/dist/FeaturedSubgraphs/useFeaturedSubgrahsQuery.d.ts +28 -0
- package/dist/FeaturedSubgraphs/useFeaturedSubgrahsQuery.d.ts.map +1 -0
- package/dist/FeaturedSubgraphs/useFeaturedSubgrahsQuery.js +109 -0
- package/dist/GlobalFooter/GlobalFooter.d.ts +28 -0
- package/dist/GlobalFooter/GlobalFooter.d.ts.map +1 -0
- package/dist/GlobalFooter/GlobalFooter.js +300 -0
- package/dist/GlobalFooter/index.d.ts +2 -0
- package/dist/GlobalFooter/index.d.ts.map +1 -0
- package/dist/GlobalHeader/GlobalHeader.d.ts +4477 -0
- package/dist/GlobalHeader/GlobalHeader.d.ts.map +1 -0
- package/dist/GlobalHeader/GlobalHeader.js +1045 -0
- package/dist/GlobalHeader/index.d.ts +2 -0
- package/dist/GlobalHeader/index.d.ts.map +1 -0
- package/dist/MarketingNavbar/MarketingNavbar.d.ts +9 -0
- package/dist/MarketingNavbar/MarketingNavbar.d.ts.map +1 -0
- package/dist/MarketingNavbar/MarketingNavbar.js +566 -0
- package/dist/MarketingNavbar/index.d.ts +2 -0
- package/dist/MarketingNavbar/index.d.ts.map +1 -0
- package/dist/NPSForm/NPSForm.d.ts +20 -0
- package/dist/NPSForm/NPSForm.d.ts.map +1 -0
- package/dist/NPSForm/NPSForm.js +205 -0
- package/dist/NPSForm/index.d.ts +2 -0
- package/dist/NPSForm/index.d.ts.map +1 -0
- package/dist/NetworkIcon/NetworkIcon.d.ts +11 -0
- package/dist/NetworkIcon/NetworkIcon.d.ts.map +1 -0
- package/dist/NetworkIcon/NetworkIcon.js +443 -0
- package/dist/NetworkIcon/index.d.ts +2 -0
- package/dist/NetworkIcon/index.d.ts.map +1 -0
- package/dist/SupportModal/SupportModal.d.ts +6 -0
- package/dist/SupportModal/SupportModal.d.ts.map +1 -0
- package/dist/SupportModal/SupportModal.js +310 -0
- package/dist/SupportModal/index.d.ts +2 -0
- package/dist/SupportModal/index.d.ts.map +1 -0
- package/dist/SupportModal/submitToZendesk.d.ts +12 -0
- package/dist/SupportModal/submitToZendesk.d.ts.map +1 -0
- package/dist/SupportModal/submitToZendesk.js +26 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/jsx/src/jsx-runtime.js +10 -0
- package/dist/jsx/src/parseProps.js +48 -0
- package/package.json +95 -0
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "../jsx/src/jsx-runtime.js";
|
|
3
|
+
import { useI18n, Icon, Flex, Text, Input, Spacing, buildTransition, Opacity, BorderRadius, Dropdown, Link, LocaleSwitcher } from "@graphprotocol/gds";
|
|
4
|
+
import { useRef, useState, useId, useEffect, Fragment } from "react";
|
|
5
|
+
const defaultNewsletterConfig = {
|
|
6
|
+
subscribeUrl: "https://api.thegraph.com/subscribe/",
|
|
7
|
+
listId: "343e348856a7f969a8bb47627b0e1531"
|
|
8
|
+
};
|
|
9
|
+
function GlobalFooter({
|
|
10
|
+
baseUrl = process.env.ENVIRONMENT === "staging" ? "https://staging.thegraph.com/" : "https://thegraph.com/",
|
|
11
|
+
showLogo = false,
|
|
12
|
+
showNewsletter = false,
|
|
13
|
+
showLocaleSwitcher = false,
|
|
14
|
+
className,
|
|
15
|
+
...props
|
|
16
|
+
}) {
|
|
17
|
+
const { t, locale } = useI18n();
|
|
18
|
+
const newsletterConfig = { ...defaultNewsletterConfig, ...typeof showNewsletter === "object" ? showNewsletter : {} };
|
|
19
|
+
const newsletterInputRef = useRef(null);
|
|
20
|
+
const [newsletterEmail, setNewsletterEmail] = useState("");
|
|
21
|
+
const [newsletterStatus, setNewsletterStatus] = useState("ready");
|
|
22
|
+
const newsletterInputEnabled = newsletterStatus !== "submitting" && newsletterStatus !== "success";
|
|
23
|
+
const newsletterSubmitEnabled = newsletterInputEnabled && newsletterEmail.length > 0;
|
|
24
|
+
const newsletterErrorMessage = {
|
|
25
|
+
invalid: t("components.globalFooter.newsletterInvalidEmail"),
|
|
26
|
+
error: t("components.globalFooter.newsletterError")
|
|
27
|
+
}[newsletterStatus] ?? null;
|
|
28
|
+
const newsletterErrorId = `newsletter-error-${useId()}`;
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (typeof window !== "undefined" && window.location.hash.includes("newsletter")) {
|
|
31
|
+
setTimeout(() => {
|
|
32
|
+
var _a;
|
|
33
|
+
return (_a = newsletterInputRef.current) == null ? void 0 : _a.focus();
|
|
34
|
+
}, 0);
|
|
35
|
+
}
|
|
36
|
+
}, []);
|
|
37
|
+
const submitNewsletter = async () => {
|
|
38
|
+
var _a;
|
|
39
|
+
if (!newsletterSubmitEnabled) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (!((_a = newsletterInputRef.current) == null ? void 0 : _a.validity.valid)) {
|
|
43
|
+
setNewsletterStatus("invalid");
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
setNewsletterStatus("submitting");
|
|
48
|
+
await fetch(
|
|
49
|
+
`${newsletterConfig.subscribeUrl}?email=${encodeURIComponent(newsletterEmail)}&list=${encodeURIComponent(
|
|
50
|
+
newsletterConfig.listId
|
|
51
|
+
)}`,
|
|
52
|
+
{
|
|
53
|
+
method: "GET"
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
setNewsletterEmail("");
|
|
57
|
+
setNewsletterStatus("success");
|
|
58
|
+
setTimeout(() => setNewsletterStatus("ready"), 5e3);
|
|
59
|
+
} catch (e) {
|
|
60
|
+
console.error("Error subscribing", e);
|
|
61
|
+
setNewsletterStatus("error");
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const getHref = (href) => {
|
|
65
|
+
if (!baseUrl || !href.startsWith("/") || href.startsWith("//")) {
|
|
66
|
+
return href;
|
|
67
|
+
}
|
|
68
|
+
return `${baseUrl.replace(/\/$/, "")}${href}`;
|
|
69
|
+
};
|
|
70
|
+
return /* @__PURE__ */ jsx("div", { className, sx: { py: Spacing["32px"] }, ...props, children: /* @__PURE__ */ jsxs(Flex.Column, { align: "center", gap: Spacing["32px"], children: [
|
|
71
|
+
showLogo ? /* @__PURE__ */ jsx(Icon.LogoTheGraph, { size: "40px" }) : null,
|
|
72
|
+
showNewsletter ? /* @__PURE__ */ jsx("div", { sx: { width: "344px", maxWidth: "100%" }, children: newsletterStatus === "success" ? /* @__PURE__ */ jsx(Flex.Center, { role: "status", sx: { height: "64px" }, children: /* @__PURE__ */ jsx(Text, { align: "center", weight: "MEDIUM", size: "16px", color: "Green", children: t("components.globalFooter.newsletterSuccess") }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
73
|
+
/* @__PURE__ */ jsx(
|
|
74
|
+
Input,
|
|
75
|
+
{
|
|
76
|
+
ref: newsletterInputRef,
|
|
77
|
+
type: "email",
|
|
78
|
+
placeholder: "Subscribe to our newsletter",
|
|
79
|
+
"aria-label": "Subscribe to our newsletter",
|
|
80
|
+
disabled: !newsletterInputEnabled,
|
|
81
|
+
value: newsletterEmail,
|
|
82
|
+
onChange: (event) => {
|
|
83
|
+
setNewsletterEmail(event.target.value);
|
|
84
|
+
setNewsletterStatus("ready");
|
|
85
|
+
},
|
|
86
|
+
onKeyDown: (event) => {
|
|
87
|
+
if (event.key === "Enter") {
|
|
88
|
+
void submitNewsletter();
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
sx: {
|
|
92
|
+
input: {
|
|
93
|
+
pr: Spacing["48px"]
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
trailingAdornment: /* @__PURE__ */ jsxs(
|
|
97
|
+
"button",
|
|
98
|
+
{
|
|
99
|
+
type: "button",
|
|
100
|
+
disabled: !newsletterSubmitEnabled,
|
|
101
|
+
onClick: () => void submitNewsletter(),
|
|
102
|
+
sx: {
|
|
103
|
+
width: "32px",
|
|
104
|
+
height: "32px"
|
|
105
|
+
},
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ jsx(
|
|
108
|
+
"span",
|
|
109
|
+
{
|
|
110
|
+
sx: {
|
|
111
|
+
position: "absolute",
|
|
112
|
+
inset: 0,
|
|
113
|
+
borderRadius: BorderRadius.FULL,
|
|
114
|
+
backgroundColor: "Purple",
|
|
115
|
+
opacity: newsletterSubmitEnabled ? Opacity["100%"] : Opacity["0%"],
|
|
116
|
+
transform: "scale(1)",
|
|
117
|
+
"button:hover &": {
|
|
118
|
+
transform: "scale(1.25)"
|
|
119
|
+
},
|
|
120
|
+
transition: buildTransition("ALL")
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
/* @__PURE__ */ jsx(Flex.Center, { sx: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsx(
|
|
125
|
+
Icon.ArrowSpecialRight,
|
|
126
|
+
{
|
|
127
|
+
title: "Submit",
|
|
128
|
+
sx: {
|
|
129
|
+
opacity: newsletterSubmitEnabled ? Opacity["100%"] : Opacity["32%"],
|
|
130
|
+
transition: buildTransition("OPACITY")
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
) })
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
),
|
|
137
|
+
"aria-describedby": newsletterErrorMessage ? newsletterErrorId : void 0
|
|
138
|
+
}
|
|
139
|
+
),
|
|
140
|
+
newsletterErrorMessage ? /* @__PURE__ */ jsx(
|
|
141
|
+
Text,
|
|
142
|
+
{
|
|
143
|
+
id: newsletterErrorId,
|
|
144
|
+
role: "alert",
|
|
145
|
+
align: "center",
|
|
146
|
+
weight: "MEDIUM",
|
|
147
|
+
size: "16px",
|
|
148
|
+
color: "Red",
|
|
149
|
+
sx: { mt: Spacing["8px"] },
|
|
150
|
+
children: newsletterErrorMessage
|
|
151
|
+
}
|
|
152
|
+
) : null
|
|
153
|
+
] }) }) : null,
|
|
154
|
+
/* @__PURE__ */ jsxs("nav", { children: [
|
|
155
|
+
/* @__PURE__ */ jsx(Flex.Row, { as: "ul", wrap: true, justify: "center", gapX: Spacing["32px"], gapY: Spacing["16px"], children: [
|
|
156
|
+
{
|
|
157
|
+
label: t("components.globalFooter.home"),
|
|
158
|
+
href: `/${locale}/`
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
label: t("components.globalFooter.blog"),
|
|
162
|
+
href: "/blog/"
|
|
163
|
+
},
|
|
164
|
+
/*
|
|
165
|
+
{
|
|
166
|
+
label: t('components.globalFooter.jobs'),
|
|
167
|
+
href: '/jobs/',
|
|
168
|
+
},
|
|
169
|
+
*/
|
|
170
|
+
{
|
|
171
|
+
label: t("components.globalFooter.docs"),
|
|
172
|
+
href: `/docs/${locale}/`
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
label: t("components.globalFooter.pastEvents"),
|
|
176
|
+
items: [
|
|
177
|
+
{
|
|
178
|
+
label: "Graph Day 2022",
|
|
179
|
+
href: "/graph-day/2022/"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
label: "Graph Hack 2022",
|
|
183
|
+
href: "/graph-hack/2022/"
|
|
184
|
+
}
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
].map(({ label, href, items }, navItemIndex) => /* @__PURE__ */ jsx("li", { children: items ? /* @__PURE__ */ jsxs(Dropdown, { type: "menu", children: [
|
|
188
|
+
/* @__PURE__ */ jsx(Dropdown.Button, { asChild: true, children: /* @__PURE__ */ jsxs(Link, { size: ["14px", null, "16px"], autoIcon: false, children: [
|
|
189
|
+
label,
|
|
190
|
+
/* @__PURE__ */ jsx(Icon.CaretDown, {})
|
|
191
|
+
] }) }),
|
|
192
|
+
/* @__PURE__ */ jsx(Dropdown.Menu, { children: items.map((item, itemIndex) => /* @__PURE__ */ jsx(Dropdown.Menu.Item, { href: getHref(item.href), children: item.label }, itemIndex)) })
|
|
193
|
+
] }) : /* @__PURE__ */ jsx(Link, { href: getHref(href), size: ["14px", null, "16px"], autoIcon: false, children: label }) }, navItemIndex)) }),
|
|
194
|
+
/* @__PURE__ */ jsx(
|
|
195
|
+
Flex.Row,
|
|
196
|
+
{
|
|
197
|
+
as: "ul",
|
|
198
|
+
wrap: true,
|
|
199
|
+
justify: "center",
|
|
200
|
+
gapX: Spacing["24px"],
|
|
201
|
+
gapY: Spacing["8px"],
|
|
202
|
+
sx: { mt: Spacing["24px"] },
|
|
203
|
+
children: [
|
|
204
|
+
{
|
|
205
|
+
label: t("components.globalFooter.status"),
|
|
206
|
+
href: "https://status.thegraph.com/"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
label: t("components.globalFooter.testnet"),
|
|
210
|
+
href: "https://testnet.thegraph.com/"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
label: t("components.globalFooter.privacyPolicy"),
|
|
214
|
+
href: "/privacy/"
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
label: t("components.globalFooter.termsOfService"),
|
|
218
|
+
href: "/terms-of-service/"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
label: t("components.globalFooter.brandAssets"),
|
|
222
|
+
href: "/brand/"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
label: t("components.globalFooter.partnershipRequests"),
|
|
226
|
+
href: "https://thegraph.typeform.com/to/rhYddDRu",
|
|
227
|
+
target: "_blank"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
label: t("components.globalFooter.forum"),
|
|
231
|
+
href: "https://forum.thegraph.com/",
|
|
232
|
+
target: "_blank"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
label: t("components.globalFooter.security"),
|
|
236
|
+
href: "https://immunefi.com/bounty/thegraph/",
|
|
237
|
+
target: "_blank"
|
|
238
|
+
}
|
|
239
|
+
].map(({ label, href, target }, navItemIndex) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Link.Secondary, { href: getHref(href), target, size: "14px", autoIcon: target === "_blank", children: label }) }, navItemIndex))
|
|
240
|
+
}
|
|
241
|
+
)
|
|
242
|
+
] }),
|
|
243
|
+
/* @__PURE__ */ jsxs(Flex.Row, { as: "ul", wrap: true, justify: "center", gapX: Spacing["32px"], gapY: Spacing["16px"], children: [
|
|
244
|
+
[
|
|
245
|
+
{
|
|
246
|
+
icon: Icon.LogoGitHub,
|
|
247
|
+
href: "https://github.com/graphprotocol"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
icon: Icon.LogoX,
|
|
251
|
+
href: "https://x.com/graphprotocol"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
icon: Icon.LogoThreads,
|
|
255
|
+
href: "https://www.threads.net/@graphprotocol"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
icon: Icon.LogoInstagram,
|
|
259
|
+
href: "https://www.instagram.com/graphprotocol/"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
icon: Icon.LogoFarcaster,
|
|
263
|
+
href: "https://farcaster.xyz/graphprotocol"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
icon: Icon.LogoDiscord,
|
|
267
|
+
href: "https://discord.gg/graphprotocol"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
icon: Icon.LogoTelegram,
|
|
271
|
+
href: "https://t.me/graphprotocol"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
icon: Icon.LogoReddit,
|
|
275
|
+
href: "https://www.reddit.com/r/thegraph/"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
icon: Icon.LogoSpotify,
|
|
279
|
+
href: "https://open.spotify.com/show/2qU70VOmQYQCTMVPOeZ4EU"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
icon: Icon.LogoYouTube,
|
|
283
|
+
href: "https://www.youtube.com/@GraphProtocol"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
icon: Icon.LogoLinkedIn,
|
|
287
|
+
href: "https://www.linkedin.com/company/thegraph/"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
icon: Icon.Mail,
|
|
291
|
+
href: "mailto:info@thegraph.com"
|
|
292
|
+
}
|
|
293
|
+
].map(({ icon: Icon2, href }, navItemIndex) => /* @__PURE__ */ jsx("li", { sx: { display: "flex", alignItems: "center", minHeight: "32px" }, children: /* @__PURE__ */ jsx(Link, { href: getHref(href), target: "_blank", autoIcon: false, children: /* @__PURE__ */ jsx(Icon2, {}) }) }, navItemIndex)),
|
|
294
|
+
showLocaleSwitcher ? /* @__PURE__ */ jsx(LocaleSwitcher, { sx: { "&:dir(rtl)": { order: -1 } } }) : null
|
|
295
|
+
] })
|
|
296
|
+
] }) });
|
|
297
|
+
}
|
|
298
|
+
export {
|
|
299
|
+
GlobalFooter
|
|
300
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/GlobalFooter/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA"}
|