@openeventkit/event-site 2.0.115 → 2.0.116
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/gatsby-browser.js +3 -3
- package/gatsby-config.mjs +9 -8
- package/gatsby-node.js +25 -27
- package/package.json +2 -2
- package/src/cms/config/collections/defaultPagesCollection/invitationsRejectPage/index.js +6 -6
- package/src/components/Footer/template.js +3 -2
- package/src/components/FooterMarketing.js +1 -1
- package/src/components/MarketingHero/ImagesColumn.js +2 -2
- package/src/components/MarketingHero/index.js +1 -1
- package/src/components/Seo.js +3 -3
- package/src/content/site-settings/index.json +50 -1
- package/src/defaults/colors.json +33 -1
- package/src/styles/colors.scss +36 -33
- package/src/styles/fonts.scss +2 -2
- package/src/templates/marketing-page-template/MainColumn.js +54 -43
- package/src/templates/marketing-page-template/index.js +14 -14
- package/src/utils/envVariables.js +94 -94
- package/src/utils/filePath.js +2 -2
- package/src/utils/scssUtils.js +146 -0
- package/src/utils/useSiteSettings.js +1 -5
- package/src/utils/cssUtils.js +0 -62
package/gatsby-browser.js
CHANGED
|
@@ -34,9 +34,9 @@ export const onClientEntry = () => {
|
|
|
34
34
|
document.documentElement.style.setProperty(`--${key}50`, `${value}50`);
|
|
35
35
|
});
|
|
36
36
|
// set theme
|
|
37
|
-
const themeSetting = marketingSettings.find(ms => ms.key ===
|
|
38
|
-
const theme = themeSetting?.value ||
|
|
39
|
-
document.documentElement.setAttribute(
|
|
37
|
+
const themeSetting = marketingSettings.find(ms => ms.key === "EVENT_SITE_COLOR_SCHEME");
|
|
38
|
+
const theme = themeSetting?.value || "LIGHT";
|
|
39
|
+
document.documentElement.setAttribute("data-theme", theme);
|
|
40
40
|
|
|
41
41
|
// init sentry
|
|
42
42
|
const GATSBY_SENTRY_DSN = process.env.GATSBY_SENTRY_DSN;
|
package/gatsby-config.mjs
CHANGED
|
@@ -26,26 +26,27 @@ const {
|
|
|
26
26
|
let siteSettings = require(`./${SITE_SETTINGS_FILE_PATH}`);
|
|
27
27
|
try {
|
|
28
28
|
siteSettings = require(path.resolve(SITE_SETTINGS_FILE_PATH));
|
|
29
|
-
}
|
|
30
|
-
catch (e) {
|
|
29
|
+
} catch (e) {
|
|
31
30
|
console.log("Falling back to default site settings.")
|
|
32
31
|
}
|
|
33
32
|
|
|
34
|
-
const
|
|
35
|
-
|
|
33
|
+
const packageJson = require(path.resolve(__dirname, "package.json"));
|
|
34
|
+
|
|
35
|
+
const title = siteSettings?.siteMetadata?.title || process.env.GATSBY_METADATA_TITLE;
|
|
36
|
+
const description = siteSettings?.siteMetadata?.description || process.env.GATSBY_METADATA_DESCRIPTION;
|
|
36
37
|
const faviconAsset = siteSettings?.favicon?.asset;
|
|
37
38
|
|
|
38
39
|
const manifestPlugin = faviconAsset ? [
|
|
39
40
|
{
|
|
40
41
|
resolve: "gatsby-plugin-manifest",
|
|
41
42
|
options: {
|
|
42
|
-
name: title,
|
|
43
|
-
short_name: title,
|
|
44
|
-
description: description,
|
|
43
|
+
name: title ?? packageJson.description,
|
|
44
|
+
short_name: title ?? packageJson.description,
|
|
45
45
|
start_url: "/",
|
|
46
46
|
display: "minimal-ui",
|
|
47
47
|
icon: path.join(SITE_SETTINGS_DIR_PATH, faviconAsset),
|
|
48
|
-
include_favicon: true
|
|
48
|
+
include_favicon: true,
|
|
49
|
+
...description && { description }
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
52
|
] : [];
|
package/gatsby-node.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const axios = require("axios");
|
|
2
2
|
const path = require("path");
|
|
3
|
-
const fs = require("fs
|
|
3
|
+
const fs = require("fs");
|
|
4
4
|
const webpack = require("webpack");
|
|
5
5
|
const {
|
|
6
6
|
createFilePath
|
|
@@ -16,6 +16,7 @@ const {
|
|
|
16
16
|
REQUIRED_DIR_PATHS,
|
|
17
17
|
DEFAULT_COLORS_FILE_PATH,
|
|
18
18
|
COLORS_FILE_PATH,
|
|
19
|
+
COLORS_SCSS_FILE_PATH,
|
|
19
20
|
SITE_SETTINGS_FILE_PATH,
|
|
20
21
|
SUMMIT_FILE_PATH,
|
|
21
22
|
EVENTS_FILE_PATH,
|
|
@@ -29,7 +30,12 @@ const {
|
|
|
29
30
|
SPONSORS_FILE_PATH,
|
|
30
31
|
FONTS_SCSS_FILE_PATH
|
|
31
32
|
} = require("./src/utils/filePath");
|
|
32
|
-
|
|
33
|
+
|
|
34
|
+
const {
|
|
35
|
+
generateAndWriteScssFile,
|
|
36
|
+
generateFontScssFile,
|
|
37
|
+
generateColorsScssFile
|
|
38
|
+
} = require("./src/utils/scssUtils");
|
|
33
39
|
|
|
34
40
|
const fileBuildTimes = [];
|
|
35
41
|
|
|
@@ -228,8 +234,8 @@ exports.onPreBootstrap = async () => {
|
|
|
228
234
|
const summitId = process.env.GATSBY_SUMMIT_ID;
|
|
229
235
|
const summitApiBaseUrl = process.env.GATSBY_SUMMIT_API_BASE_URL;
|
|
230
236
|
let marketingSettings = await SSR_getMarketingSettings(process.env.GATSBY_MARKETING_API_BASE_URL, summitId);
|
|
231
|
-
const colorSettings = fs.existsSync(COLORS_FILE_PATH) ? JSON.parse(fs.readFileSync(COLORS_FILE_PATH)) : require(`./${DEFAULT_COLORS_FILE_PATH}`);
|
|
232
237
|
const siteSettings = fs.existsSync(SITE_SETTINGS_FILE_PATH) ? JSON.parse(fs.readFileSync(SITE_SETTINGS_FILE_PATH)) : {};
|
|
238
|
+
const colors = fs.existsSync(COLORS_FILE_PATH) ? JSON.parse(fs.readFileSync(COLORS_FILE_PATH)) : require(`./${DEFAULT_COLORS_FILE_PATH}`);
|
|
233
239
|
|
|
234
240
|
const config = {
|
|
235
241
|
client: {
|
|
@@ -247,12 +253,12 @@ exports.onPreBootstrap = async () => {
|
|
|
247
253
|
|
|
248
254
|
const accessToken = await getAccessToken(config, process.env.GATSBY_BUILD_SCOPES).then(({ token }) => token.access_token);
|
|
249
255
|
|
|
250
|
-
const FileType =
|
|
256
|
+
const FileType = "FILE";
|
|
251
257
|
// extract colors from marketing settings
|
|
252
|
-
marketingSettings = marketingSettings.map(
|
|
253
|
-
if (entry.key.startsWith("color_"))
|
|
254
|
-
if(entry.type === FileType) return {...entry, value: entry.file};
|
|
255
|
-
return {...entry};
|
|
258
|
+
marketingSettings = marketingSettings.map(entry => {
|
|
259
|
+
if (entry.key.startsWith("color_")) colors[entry.key] = entry.value;
|
|
260
|
+
if (entry.type === FileType) return { ...entry, value: entry.file };
|
|
261
|
+
return { ...entry };
|
|
256
262
|
});
|
|
257
263
|
|
|
258
264
|
// create required directories
|
|
@@ -263,7 +269,17 @@ exports.onPreBootstrap = async () => {
|
|
|
263
269
|
});
|
|
264
270
|
|
|
265
271
|
fs.writeFileSync(MARKETING_SETTINGS_FILE_PATH, JSON.stringify(marketingSettings), "utf8");
|
|
266
|
-
|
|
272
|
+
|
|
273
|
+
// write colors json used to set runtime colors in gatsby-browser
|
|
274
|
+
fs.writeFileSync(COLORS_FILE_PATH, JSON.stringify(colors), "utf8");
|
|
275
|
+
|
|
276
|
+
// generate and write colors SCSS file used by built styles
|
|
277
|
+
generateAndWriteScssFile(generateColorsScssFile, colors, COLORS_SCSS_FILE_PATH);
|
|
278
|
+
|
|
279
|
+
if (siteSettings.siteFont) {
|
|
280
|
+
// generate and write font SCSS file used by built styles
|
|
281
|
+
generateAndWriteScssFile(generateFontScssFile, siteSettings.siteFont, FONTS_SCSS_FILE_PATH);
|
|
282
|
+
}
|
|
267
283
|
|
|
268
284
|
// summit
|
|
269
285
|
const summit = await SSR_getSummit(summitApiBaseUrl, summitId);
|
|
@@ -292,7 +308,6 @@ exports.onPreBootstrap = async () => {
|
|
|
292
308
|
});
|
|
293
309
|
fs.writeFileSync(EVENTS_IDX_FILE_PATH, JSON.stringify(allEventsIDX), "utf8");
|
|
294
310
|
|
|
295
|
-
|
|
296
311
|
// Show Speakers
|
|
297
312
|
const allSpeakers = await SSR_getSpeakers(summitApiBaseUrl, summitId, accessToken);
|
|
298
313
|
console.log(`allSpeakers ${allSpeakers.length}`);
|
|
@@ -335,23 +350,6 @@ exports.onPreBootstrap = async () => {
|
|
|
335
350
|
siteSettings.lastBuild = Date.now();
|
|
336
351
|
|
|
337
352
|
fs.writeFileSync(SITE_SETTINGS_FILE_PATH, JSON.stringify(siteSettings), "utf8");
|
|
338
|
-
|
|
339
|
-
// Read fonts from site settings
|
|
340
|
-
const siteFonts = siteSettings.siteFont;
|
|
341
|
-
|
|
342
|
-
if(siteFonts && Object.keys(siteFonts).length > 0) {
|
|
343
|
-
// Generate the SCSS file
|
|
344
|
-
const scssFontsFile = generateFontFile(siteFonts);
|
|
345
|
-
if (scssFontsFile) {
|
|
346
|
-
const standalone = __dirname === path.resolve();
|
|
347
|
-
let fontFilePath = FONTS_SCSS_FILE_PATH;
|
|
348
|
-
if (!standalone) {
|
|
349
|
-
fontFilePath = `${__dirname}/${fontFilePath}`;
|
|
350
|
-
}
|
|
351
|
-
fs.writeFileSync(fontFilePath, scssFontsFile);
|
|
352
|
-
console.log(`CUSTOM FONT FILE ${fontFilePath} generated.`);
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
353
|
};
|
|
356
354
|
|
|
357
355
|
exports.createSchemaCustomization = async ({ actions, reporter, getNodeAndSavePathDependency }) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openeventkit/event-site",
|
|
3
3
|
"description": "Event Site",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.116",
|
|
5
5
|
"author": "Tipit LLC",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@fortawesome/fontawesome-svg-core": "^6.5.2",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@vimeo/player": "^2.16.3",
|
|
29
29
|
"ably": "^1.2.34",
|
|
30
30
|
"assert": "^2.1.0",
|
|
31
|
-
"attendee-to-attendee-widget": "3.0
|
|
31
|
+
"attendee-to-attendee-widget": "3.1.0",
|
|
32
32
|
"awesome-bootstrap-checkbox": "^1.0.1",
|
|
33
33
|
"axios": "^0.19.2",
|
|
34
34
|
"babel-preset-gatsby": "^3.13.2",
|
|
@@ -20,18 +20,18 @@ const invitationsRejectPage = {
|
|
|
20
20
|
required: false,
|
|
21
21
|
default: "Invitation not found."
|
|
22
22
|
}),
|
|
23
|
-
stringField({
|
|
24
|
-
label: "Rejected text",
|
|
25
|
-
name: "rejectedText",
|
|
26
|
-
required: false,
|
|
27
|
-
default: "Invitation has already been rejected."
|
|
28
|
-
}),
|
|
29
23
|
stringField({
|
|
30
24
|
label: "Reject text",
|
|
31
25
|
name: "rejectText",
|
|
32
26
|
required: false,
|
|
33
27
|
default: "To reject please click on the button below."
|
|
34
28
|
}),
|
|
29
|
+
stringField({
|
|
30
|
+
label: "Reject Confirmation Text",
|
|
31
|
+
name: "rejectedText",
|
|
32
|
+
required: false,
|
|
33
|
+
default: "Invitation has already been rejected."
|
|
34
|
+
}),
|
|
35
35
|
stringField({
|
|
36
36
|
label: "Reject CTA label",
|
|
37
37
|
name: "rejectCTALabel",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
2
3
|
import FooterMarketing from "../FooterMarketing";
|
|
3
4
|
import Link from "../Link";
|
|
4
5
|
|
|
@@ -29,7 +30,7 @@ const FooterTemplate = ({ data, summit, marketing }) => {
|
|
|
29
30
|
{data.social.networks.map((net, index) => (
|
|
30
31
|
net.display &&
|
|
31
32
|
<Link to={net.link} key={index}>
|
|
32
|
-
<
|
|
33
|
+
<FontAwesomeIcon icon={`fa-brands ${net.icon}`} size="lg" />
|
|
33
34
|
</Link>
|
|
34
35
|
))}
|
|
35
36
|
</div>
|
|
@@ -81,7 +82,7 @@ const FooterTemplate = ({ data, summit, marketing }) => {
|
|
|
81
82
|
{data.social.networks.map((net, index) => (
|
|
82
83
|
net.display &&
|
|
83
84
|
<Link to={net.link} className={styles.link} key={index}>
|
|
84
|
-
<
|
|
85
|
+
<FontAwesomeIcon icon={`fa-brands ${net.icon}`} size="lg" />
|
|
85
86
|
</Link>
|
|
86
87
|
))}
|
|
87
88
|
</div>
|
|
@@ -22,7 +22,7 @@ const ImagesColumn = ({ images }) => {
|
|
|
22
22
|
<img
|
|
23
23
|
key={index}
|
|
24
24
|
src={getSrc(image.src)}
|
|
25
|
-
alt={image.alt}
|
|
25
|
+
alt={image.alt ?? ""}
|
|
26
26
|
/>
|
|
27
27
|
))}
|
|
28
28
|
</Slider>
|
|
@@ -30,7 +30,7 @@ const ImagesColumn = ({ images }) => {
|
|
|
30
30
|
<GatsbyImage
|
|
31
31
|
className={styles.singleImage}
|
|
32
32
|
image={getImage(images[0].src)}
|
|
33
|
-
alt={images[0].alt}
|
|
33
|
+
alt={images[0].alt ?? ""}
|
|
34
34
|
/>
|
|
35
35
|
)}
|
|
36
36
|
</div>
|
package/src/components/Seo.js
CHANGED
|
@@ -2,7 +2,6 @@ import * as React from "react";
|
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import useSiteMetadata from "@utils/useSiteMetadata";
|
|
4
4
|
import useSiteSettings from "@utils/useSiteSettings";
|
|
5
|
-
import { getSrc } from "gatsby-plugin-image";
|
|
6
5
|
import { buildUrl } from "@utils/urlFormating";
|
|
7
6
|
import { getEnvVariable, SITE_URL } from "@utils/envVariables";
|
|
8
7
|
|
|
@@ -13,7 +12,7 @@ const Seo = ({ title, description, location, children }) => {
|
|
|
13
12
|
} = useSiteMetadata();
|
|
14
13
|
|
|
15
14
|
const siteSettings = useSiteSettings();
|
|
16
|
-
const image = siteSettings?.siteMetadata?.image
|
|
15
|
+
const image = siteSettings?.siteMetadata?.image;
|
|
17
16
|
|
|
18
17
|
const siteUrl = getEnvVariable(SITE_URL);
|
|
19
18
|
const siteUrlInfo = siteUrl ? new URL(siteUrl) : null;
|
|
@@ -25,8 +24,9 @@ const Seo = ({ title, description, location, children }) => {
|
|
|
25
24
|
title: title ? `${siteTitle} - ${title}` : siteTitle,
|
|
26
25
|
description: description || defaultDescription,
|
|
27
26
|
url: buildUrl(scheme, host, pathname),
|
|
28
|
-
image: host && image ? buildUrl(scheme, host,
|
|
27
|
+
image: host && image ? buildUrl(scheme, host, image.publicURL) : null,
|
|
29
28
|
};
|
|
29
|
+
|
|
30
30
|
return (
|
|
31
31
|
<>
|
|
32
32
|
{seo.title && <title>{seo.title}</title>}
|
|
@@ -1 +1,50 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"favicon": {
|
|
3
|
+
"asset": "icon.png"
|
|
4
|
+
},
|
|
5
|
+
"widgets": {
|
|
6
|
+
"chat": {
|
|
7
|
+
"enabled": true,
|
|
8
|
+
"showQA": false,
|
|
9
|
+
"showHelp": false,
|
|
10
|
+
"defaultScope": "page"
|
|
11
|
+
},
|
|
12
|
+
"schedule": {
|
|
13
|
+
"allowClick": true
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"identityProviderButtons": [
|
|
17
|
+
{
|
|
18
|
+
"buttonColor": "#082238",
|
|
19
|
+
"providerLabel": "Continue with FNid",
|
|
20
|
+
"providerLogo": "logo_fn.svg",
|
|
21
|
+
"providerLogoSize": 27
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"buttonColor": "#0A66C2",
|
|
25
|
+
"providerLabel": "Sign in with LinkedIn",
|
|
26
|
+
"providerParam": "linkedin",
|
|
27
|
+
"providerLogo": "logo_linkedin.svg",
|
|
28
|
+
"providerLogoSize": 18
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"buttonColor": "#000000",
|
|
32
|
+
"providerLabel": "Sign in with Apple",
|
|
33
|
+
"providerParam": "apple",
|
|
34
|
+
"providerLogoSize": 17,
|
|
35
|
+
"providerLogo": "logo_apple.svg"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"buttonColor": "#1877F2",
|
|
39
|
+
"providerLabel": "Login with Facebook",
|
|
40
|
+
"providerParam": "facebook",
|
|
41
|
+
"providerLogo": "logo_facebook.svg",
|
|
42
|
+
"providerLogoSize": 20
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"maintenanceMode": {
|
|
46
|
+
"enabled": false,
|
|
47
|
+
"title": "Site under maintenance",
|
|
48
|
+
"subtitle": "Please reload page shortly"
|
|
49
|
+
}
|
|
50
|
+
}
|
package/src/defaults/colors.json
CHANGED
|
@@ -1 +1,33 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"color_accent": "#ff5e32",
|
|
3
|
+
"color_alerts": "#ff0000",
|
|
4
|
+
"color_background_light": "#ffffff",
|
|
5
|
+
"color_background_dark": "#000000",
|
|
6
|
+
"color_button_background_color": "#ffffff",
|
|
7
|
+
"color_button_color": "#000000",
|
|
8
|
+
"color_gray_lighter": "#f2f2f2",
|
|
9
|
+
"color_gray_light": "#dfdfdf",
|
|
10
|
+
"color_gray_dark": "#999999",
|
|
11
|
+
"color_gray_darker": "#4a4a4a",
|
|
12
|
+
"color_horizontal_rule_light": "#e5e5e5",
|
|
13
|
+
"color_horizontal_rule_dark": "#7b7b7b",
|
|
14
|
+
"color_icon_light": "#ffffff",
|
|
15
|
+
"color_input_background_color_light": "#ffffff",
|
|
16
|
+
"color_input_background_color_dark": "#181a1b",
|
|
17
|
+
"color_input_border_color_light": "#dbdbdb",
|
|
18
|
+
"color_input_border_color_dark": "#3a3f41",
|
|
19
|
+
"color_input_text_color_light": "#363636",
|
|
20
|
+
"color_input_text_color_dark": "#ffffff",
|
|
21
|
+
"color_input_text_color_disabled_light": "#ffffff",
|
|
22
|
+
"color_input_text_color_disabled_dark": "#ffffff",
|
|
23
|
+
"color_primary": "#6d6e71",
|
|
24
|
+
"color_primary_contrast": "#f1f2f2",
|
|
25
|
+
"color_secondary": "#00cec4",
|
|
26
|
+
"color_secondary_contrast": "#ff5e32",
|
|
27
|
+
"color_text_light": "#ffffff",
|
|
28
|
+
"color_text_med": "#828282",
|
|
29
|
+
"color_text_dark": "#333333",
|
|
30
|
+
"color_text_input_hints_light": "#7b7b7b",
|
|
31
|
+
"color_text_input_hints_dark": "#7b7b7b",
|
|
32
|
+
"color_text_input_hints": "#c4c4c4"
|
|
33
|
+
}
|
package/src/styles/colors.scss
CHANGED
|
@@ -1,34 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Warning:
|
|
3
|
+
* Dont edit this file by hand, has been generated by colors scss util
|
|
4
|
+
* Uses default colors as base and then overriden by colors set via marketing
|
|
5
|
+
**/
|
|
6
|
+
|
|
7
|
+
$color_accent: #ff5e32;
|
|
8
|
+
$color_alerts: #ff0000;
|
|
6
9
|
$color_background_light: #ffffff;
|
|
7
10
|
$color_background_dark: #000000;
|
|
8
|
-
$
|
|
9
|
-
$
|
|
10
|
-
$
|
|
11
|
-
$
|
|
12
|
-
$color_gray_dark
|
|
13
|
-
$
|
|
14
|
-
$
|
|
15
|
-
$
|
|
11
|
+
$color_button_background_color: #ffffff;
|
|
12
|
+
$color_button_color: #000000;
|
|
13
|
+
$color_gray_lighter: #F2F2F2;
|
|
14
|
+
$color_gray_light: #DFDFDF;
|
|
15
|
+
$color_gray_dark: #999999;
|
|
16
|
+
$color_gray_darker: #4A4A4A;
|
|
17
|
+
$color_horizontal_rule_light: #e5e5e5;
|
|
18
|
+
$color_horizontal_rule_dark: #7b7b7b;
|
|
19
|
+
$color_icon_light: #ffffff;
|
|
20
|
+
$color_input_background_color_light: #ffffff;
|
|
21
|
+
$color_input_background_color_dark: #181a1b;
|
|
22
|
+
$color_input_border_color_light: #dbdbdb;
|
|
23
|
+
$color_input_border_color_dark: #3a3f41;
|
|
16
24
|
$color_input_text_color_light: #363636;
|
|
17
|
-
$
|
|
18
|
-
$
|
|
19
|
-
$
|
|
20
|
-
$
|
|
21
|
-
$
|
|
22
|
-
$
|
|
23
|
-
$
|
|
24
|
-
$
|
|
25
|
-
$
|
|
26
|
-
$
|
|
27
|
-
$color_text_input_hints_light
|
|
28
|
-
$color_text_input_hints_dark
|
|
29
|
-
$
|
|
30
|
-
$color_button_color:#000000;
|
|
31
|
-
$color_alerts:#FF0000;
|
|
25
|
+
$color_input_text_color_dark: #ffffff;
|
|
26
|
+
$color_input_text_color_disabled_light: #ffffff;
|
|
27
|
+
$color_input_text_color_disabled_dark: #ffffff;
|
|
28
|
+
$color_primary: #6d6e71;
|
|
29
|
+
$color_primary_contrast: #f1f2f2;
|
|
30
|
+
$color_secondary: #00CEC4;
|
|
31
|
+
$color_secondary_contrast: #ff5e32;
|
|
32
|
+
$color_text_light: #ffffff;
|
|
33
|
+
$color_text_med: #828282;
|
|
34
|
+
$color_text_dark: #333333;
|
|
35
|
+
$color_text_input_hints_light: #7b7b7b;
|
|
36
|
+
$color_text_input_hints_dark: #7b7b7b;
|
|
37
|
+
$color_text_input_hints: #c4c4c4;
|
|
32
38
|
|
|
33
39
|
:root {
|
|
34
40
|
--color_primary: #{$color_primary};
|
|
@@ -45,7 +51,6 @@ $color_alerts:#FF0000;
|
|
|
45
51
|
--color_gray_light: #{$color_gray_light};
|
|
46
52
|
--color_gray_lighter: #{$color_gray_lighter};
|
|
47
53
|
--color_input_text_color: #{$color_input_text_color_light};
|
|
48
|
-
--color_input_text_color_disabled: #{$color_input_text_color_disabled_light};
|
|
49
54
|
--color_input_background_color: #{$color_input_background_color_light};
|
|
50
55
|
--color_input_border_color: #{$color_input_border_color_light};
|
|
51
56
|
--color_text_input_hints: #{$color_text_input_hints_light};
|
|
@@ -55,7 +60,6 @@ $color_alerts:#FF0000;
|
|
|
55
60
|
--color_button_color: #{$color_button_color};
|
|
56
61
|
--color_alerts: #{$color_alerts};
|
|
57
62
|
}
|
|
58
|
-
|
|
59
63
|
html[data-theme="DARK"] {
|
|
60
64
|
--color_text_dark: #{$color_text_light} !important;
|
|
61
65
|
--color_text_light: #{$color_text_dark} !important;
|
|
@@ -66,9 +70,8 @@ html[data-theme="DARK"] {
|
|
|
66
70
|
--color_gray_light: #{$color_gray_dark} !important;
|
|
67
71
|
--color_gray_lighter: #{$color_gray_darker} !important;
|
|
68
72
|
--color_input_text_color: #{$color_input_text_color_dark} !important;
|
|
69
|
-
--color_input_text_color_disabled: #{$color_input_text_color_disabled_dark} !important;
|
|
70
73
|
--color_input_background_color: #{$color_input_background_color_dark} !important;
|
|
71
74
|
--color_input_border_color: #{$color_input_border_color_dark} !important;
|
|
72
75
|
--color_text_input_hints: #{$color_text_input_hints_dark} !important;
|
|
73
|
-
--color_horizontal_rule: #{$color_horizontal_rule_dark};
|
|
74
|
-
}
|
|
76
|
+
--color_horizontal_rule: #{$color_horizontal_rule_dark} !important;
|
|
77
|
+
}
|
package/src/styles/fonts.scss
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Warning:
|
|
3
|
-
* Dont edit this file by hand,
|
|
4
|
-
*
|
|
3
|
+
* Dont edit this file by hand, has been generated by fonts scss util
|
|
4
|
+
* Generated with font values set via CMS
|
|
5
5
|
**/
|
|
6
6
|
|
|
7
7
|
$font-family: 'Nunito Sans', sans-serif;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { navigate } from "gatsby";
|
|
2
3
|
import PropTypes from "prop-types";
|
|
3
4
|
import { GatsbyImage, getImage } from "gatsby-plugin-image";
|
|
4
5
|
import Mdx from "@mdx-js/runtime";
|
|
@@ -8,6 +9,8 @@ import DisqusComponent from "../../components/DisqusComponent";
|
|
|
8
9
|
import ResponsiveImage from "../../components/ResponsiveImage";
|
|
9
10
|
import Link from "../../components/Link";
|
|
10
11
|
|
|
12
|
+
import { PHASES } from "@utils/phasesUtils";
|
|
13
|
+
|
|
11
14
|
import styles from "./styles.module.scss";
|
|
12
15
|
|
|
13
16
|
const shortcodes = {
|
|
@@ -15,55 +18,63 @@ const shortcodes = {
|
|
|
15
18
|
img: ResponsiveImage
|
|
16
19
|
};
|
|
17
20
|
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
21
|
+
const onEventClick = (ev) => navigate(`/a/event/${ev.id}`);
|
|
22
|
+
|
|
23
|
+
const MainColumn = ({ widgets, summitPhase, isLoggedUser, onEventClick, lastDataSync, fullWidth, maxHeight }) => {
|
|
24
|
+
const { content, schedule, disqus, image } = widgets || {};
|
|
25
|
+
|
|
26
|
+
const scheduleProps = schedule && isLoggedUser && summitPhase !== PHASES.BEFORE ? { onEventClick } : {};
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<div
|
|
30
|
+
className={`column pt-6 pb-5 px-6 ${!fullWidth ? "is-half" : ""} ${styles.mainColumn || ""}`}
|
|
31
|
+
style={{ maxHeight: !fullWidth && maxHeight ? maxHeight : "none", overflowY: "auto" }}
|
|
32
|
+
>
|
|
33
|
+
<Container>
|
|
34
|
+
{content?.display && content?.body && (
|
|
35
|
+
<Mdx components={shortcodes}>
|
|
36
|
+
{content.body}
|
|
37
|
+
</Mdx>
|
|
38
|
+
)}
|
|
39
|
+
{schedule?.display && (
|
|
40
|
+
<>
|
|
41
|
+
<h2><b>{schedule.title}</b></h2>
|
|
42
|
+
<LiteScheduleComponent
|
|
43
|
+
{...scheduleProps}
|
|
44
|
+
lastDataSync={lastDataSync}
|
|
45
|
+
id={`marketing_lite_schedule_${lastDataSync}`}
|
|
46
|
+
page="marketing-site"
|
|
47
|
+
showAllEvents={true}
|
|
48
|
+
showSearch={false}
|
|
49
|
+
showNav={true}
|
|
50
|
+
/>
|
|
51
|
+
</>
|
|
52
|
+
)}
|
|
53
|
+
{disqus?.display && (
|
|
54
|
+
<>
|
|
55
|
+
<h2><b>{disqus.title}</b></h2>
|
|
56
|
+
<DisqusComponent page="marketing-site" />
|
|
57
|
+
</>
|
|
58
|
+
)}
|
|
59
|
+
{image?.display && image?.image.src && (
|
|
60
|
+
<>
|
|
61
|
+
<h2><b>{image.title}</b></h2>
|
|
62
|
+
<br/>
|
|
63
|
+
<GatsbyImage image={getImage(image.image.src)} alt={image.image.alt ?? ""} />
|
|
64
|
+
</>
|
|
65
|
+
)}
|
|
66
|
+
</Container>
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
59
70
|
|
|
60
71
|
MainColumn.propTypes = {
|
|
61
72
|
widgets: PropTypes.object,
|
|
62
|
-
|
|
73
|
+
summitPhase: PropTypes.number,
|
|
74
|
+
isLoggedUser: PropTypes.bool,
|
|
63
75
|
lastDataSync: PropTypes.number,
|
|
64
76
|
fullWidth: PropTypes.bool,
|
|
65
77
|
maxHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
66
78
|
};
|
|
67
79
|
|
|
68
80
|
export default MainColumn;
|
|
69
|
-
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import React, { useRef, useState
|
|
1
|
+
import React, { useRef, useState } from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
|
-
import {
|
|
3
|
+
import { NoSsr } from "@mui/base/NoSsr";
|
|
4
4
|
import Layout from "../../components/Layout";
|
|
5
5
|
import AttendanceTrackerComponent from "../../components/AttendanceTrackerComponent";
|
|
6
6
|
import MarketingHero from "../../components/MarketingHero";
|
|
7
7
|
import Countdown from "../../components/Countdown";
|
|
8
|
-
import Link from "../../components/Link";
|
|
9
8
|
import MainColumn from "./MainColumn";
|
|
10
9
|
import Masonry from "./Masonry";
|
|
11
10
|
import { useResize } from "@utils/hooks";
|
|
12
|
-
import { PHASES } from "@utils/phasesUtils";
|
|
13
11
|
|
|
14
12
|
import styles from "./styles.module.scss";
|
|
15
13
|
|
|
16
|
-
const onEventClick = (ev) => navigate(`/a/event/${ev.id}`);
|
|
17
|
-
|
|
18
14
|
const MarketingPageTemplate = ({ data, location, summit, summitPhase, isLoggedUser, lastDataSync }) => {
|
|
19
15
|
const masonryRef = useRef();
|
|
20
16
|
const [rightColumnHeight, setRightColumnHeight] = useState();
|
|
17
|
+
|
|
21
18
|
const onResize = () => {
|
|
22
19
|
if (masonryRef?.current) {
|
|
23
20
|
setRightColumnHeight(masonryRef.current.firstChild.clientHeight);
|
|
24
21
|
}
|
|
25
22
|
};
|
|
23
|
+
|
|
26
24
|
useResize(onResize);
|
|
25
|
+
|
|
27
26
|
const {
|
|
28
27
|
marketingPageJson: {
|
|
29
28
|
hero,
|
|
@@ -32,22 +31,23 @@ const MarketingPageTemplate = ({ data, location, summit, summitPhase, isLoggedUs
|
|
|
32
31
|
masonry
|
|
33
32
|
} = {}
|
|
34
33
|
} = data || {};
|
|
35
|
-
|
|
36
|
-
if (widgets?.schedule && isLoggedUser && summitPhase !== PHASES.BEFORE) {
|
|
37
|
-
return { onEventClick };
|
|
38
|
-
}
|
|
39
|
-
return {};
|
|
40
|
-
}, [widgets, isLoggedUser, summitPhase]);
|
|
34
|
+
|
|
41
35
|
const shouldRenderMasonry = masonry?.display;
|
|
36
|
+
|
|
42
37
|
return (
|
|
43
38
|
<Layout marketing={true} location={location}>
|
|
44
39
|
<AttendanceTrackerComponent />
|
|
45
40
|
<MarketingHero location={location} data={hero} />
|
|
46
|
-
{summit && countdown?.display &&
|
|
41
|
+
{summit && countdown?.display &&
|
|
42
|
+
<NoSsr>
|
|
43
|
+
<Countdown summit={summit} text={countdown?.text} />
|
|
44
|
+
</NoSsr>
|
|
45
|
+
}
|
|
47
46
|
<div className="columns is-marginless">
|
|
48
47
|
<MainColumn
|
|
49
48
|
widgets={widgets}
|
|
50
|
-
|
|
49
|
+
summitPhase={summitPhase}
|
|
50
|
+
isLoggedUser={isLoggedUser}
|
|
51
51
|
maxHeight={rightColumnHeight}
|
|
52
52
|
fullWidth={!shouldRenderMasonry}
|
|
53
53
|
lastDataSync={lastDataSync}
|
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
export const SITE_URL =
|
|
2
|
-
export const IDP_BASE_URL =
|
|
3
|
-
export const SUMMIT_API_BASE_URL =
|
|
4
|
-
export const SUMMIT_ID =
|
|
5
|
-
export const OAUTH2_CODE =
|
|
6
|
-
export const OAUTH2_CLIENT_ID =
|
|
7
|
-
export const SCOPES =
|
|
8
|
-
export const MARKETING_API_BASE_URL =
|
|
9
|
-
export const REGISTRATION_BASE_URL =
|
|
10
|
-
export const AUTHZ_USER_GROUPS =
|
|
11
|
-
export const AUTHORIZED_DEFAULT_PATH =
|
|
12
|
-
export const STREAM_IO_API_KEY =
|
|
13
|
-
export const MUX_ENV_KEY =
|
|
14
|
-
export const DISQUS_SHORTNAME =
|
|
15
|
-
export const SUPABASE_URL =
|
|
16
|
-
export const SUPABASE_KEY =
|
|
17
|
-
export const CHAT_API_BASE_URL =
|
|
18
|
-
export const SCHEDULE_EXCLUDING_TAGS =
|
|
19
|
-
export const LIVE_EVENT_THUMBNAIL_GIF_CAPTURE_STARTS =
|
|
20
|
-
export const OAUTH2_FLOW =
|
|
21
|
-
export const API_BASE_URL =
|
|
1
|
+
export const SITE_URL = "SITE_URL";
|
|
2
|
+
export const IDP_BASE_URL = "IDP_BASE_URL";
|
|
3
|
+
export const SUMMIT_API_BASE_URL = "SUMMIT_API_BASE_URL";
|
|
4
|
+
export const SUMMIT_ID = "SUMMIT_ID";
|
|
5
|
+
export const OAUTH2_CODE = "OAUTH2_CODE";
|
|
6
|
+
export const OAUTH2_CLIENT_ID = "OAUTH2_CLIENT_ID";
|
|
7
|
+
export const SCOPES = "SCOPES";
|
|
8
|
+
export const MARKETING_API_BASE_URL = "MARKETING_API_BASE_URL";
|
|
9
|
+
export const REGISTRATION_BASE_URL = "REGISTRATION_BASE_URL";
|
|
10
|
+
export const AUTHZ_USER_GROUPS = "AUTHZ_USER_GROUPS";
|
|
11
|
+
export const AUTHORIZED_DEFAULT_PATH = "AUTHORIZED_DEFAULT_PATH";
|
|
12
|
+
export const STREAM_IO_API_KEY = "STREAM_IO_API_KEY";
|
|
13
|
+
export const MUX_ENV_KEY = "MUX_ENV_KEY";
|
|
14
|
+
export const DISQUS_SHORTNAME = "DISQUS_SHORTNAME";
|
|
15
|
+
export const SUPABASE_URL = "SUPABASE_URL";
|
|
16
|
+
export const SUPABASE_KEY = "SUPABASE_KEY";
|
|
17
|
+
export const CHAT_API_BASE_URL = "CHAT_API_BASE_URL";
|
|
18
|
+
export const SCHEDULE_EXCLUDING_TAGS = "SCHEDULE_EXCLUDING_TAGS";
|
|
19
|
+
export const LIVE_EVENT_THUMBNAIL_GIF_CAPTURE_STARTS = "LIVE_EVENT_THUMBNAIL_GIF_CAPTURE_STARTS";
|
|
20
|
+
export const OAUTH2_FLOW = "OAUTH2_FLOW";
|
|
21
|
+
export const API_BASE_URL = "API_BASE_URL";
|
|
22
22
|
// TODO: SUPPORT_EMAIL needs to be set via marketing api i/o env var
|
|
23
|
-
export const SUPPORT_EMAIL =
|
|
24
|
-
export const WS_PUB_SERVER_URL =
|
|
25
|
-
export const REAL_TIME_UPDATES_STRATEGY =
|
|
26
|
-
export const TIMEINTERVALSINCE1970_API_URL =
|
|
27
|
-
export const ABLY_API_KEY =
|
|
28
|
-
export const GOOGLE_TAGMANAGER_ID =
|
|
23
|
+
export const SUPPORT_EMAIL = "SUPPORT_EMAIL";
|
|
24
|
+
export const WS_PUB_SERVER_URL = "WS_PUB_SERVER_URL";
|
|
25
|
+
export const REAL_TIME_UPDATES_STRATEGY = "REAL_TIME_UPDATES_STRATEGY";
|
|
26
|
+
export const TIMEINTERVALSINCE1970_API_URL = "TIMEINTERVALSINCE1970_API_URL";
|
|
27
|
+
export const ABLY_API_KEY = "ABLY_API_KEY";
|
|
28
|
+
export const GOOGLE_TAGMANAGER_ID = "GOOGLE_TAGMANAGER_ID";
|
|
29
29
|
|
|
30
30
|
const processEnv = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Retrieve the site URL from environment variable set by the deploy provider.
|
|
33
|
+
* See documentation for more details:
|
|
34
|
+
* - Netlify: {@link https://docs.netlify.com/configure-builds/environment-variables/#deploy-urls-and-metadata}
|
|
35
|
+
* - Cloudflare Pages: {@link https://developers.cloudflare.com/pages/platform/build-configuration#environment-variables}
|
|
36
|
+
*
|
|
37
|
+
* If not available, fallback to user-defined GATSBY_SITE_URL env var.
|
|
38
|
+
*/
|
|
39
|
+
SITE_URL: process.env.URL || process.env.CF_PAGES_URL || process.env.GATSBY_SITE_URL,
|
|
40
|
+
IDP_BASE_URL: process.env.GATSBY_IDP_BASE_URL,
|
|
41
|
+
SUMMIT_API_BASE_URL: process.env.GATSBY_SUMMIT_API_BASE_URL,
|
|
42
|
+
API_BASE_URL: process.env.GATSBY_SUMMIT_API_BASE_URL,
|
|
43
|
+
SUMMIT_ID: process.env.GATSBY_SUMMIT_ID,
|
|
44
|
+
OAUTH2_FLOW: process.env.GATSBY_OAUTH2_FLOW,
|
|
45
|
+
OAUTH2_CLIENT_ID: process.env.GATSBY_OAUTH2_CLIENT_ID,
|
|
46
|
+
SCOPES: process.env.GATSBY_SCOPES,
|
|
47
|
+
MARKETING_API_BASE_URL: process.env.GATSBY_MARKETING_API_BASE_URL,
|
|
48
|
+
REGISTRATION_BASE_URL: process.env.GATSBY_REGISTRATION_BASE_URL,
|
|
49
|
+
AUTHZ_USER_GROUPS: process.env.GATSBY_AUTHZ_USER_GROUPS,
|
|
50
|
+
AUTHORIZED_DEFAULT_PATH: process.env.GATSBY_AUTHORIZED_DEFAULT_PATH,
|
|
51
|
+
STREAM_IO_API_KEY: process.env.GATSBY_STREAM_IO_API_KEY,
|
|
52
|
+
MUX_ENV_KEY: process.env.GATSBY_MUX_ENV_KEY,
|
|
53
|
+
DISQUS_SHORTNAME: process.env.GATSBY_DISQUS_SHORTNAME,
|
|
54
|
+
SUPABASE_URL: process.env.GATSBY_SUPABASE_URL,
|
|
55
|
+
SUPABASE_KEY: process.env.GATSBY_SUPABASE_KEY,
|
|
56
|
+
CHAT_API_BASE_URL: process.env.GATSBY_CHAT_API_BASE_URL,
|
|
57
|
+
SCHEDULE_EXCLUDING_TAGS: process.env.GATSBY_SCHEDULE_EXCLUDING_TAGS,
|
|
58
|
+
LIVE_EVENT_THUMBNAIL_GIF_CAPTURE_STARTS: process.env.GATSBY_LIVE_EVENT_THUMBNAIL_GIF_CAPTURE_STARTS || 60,
|
|
59
|
+
SUPPORT_EMAIL: process.env.GATSBY_SUPPORT_EMAIL,
|
|
60
|
+
WS_PUB_SERVER_URL: process.env.GATSBY_WS_PUB_SERVER_URL,
|
|
61
|
+
// could be SUPA OR WS
|
|
62
|
+
REAL_TIME_UPDATES_STRATEGY: process.env.GATSBY_REAL_TIME_UPDATES_STRATEGY,
|
|
63
|
+
TIMEINTERVALSINCE1970_API_URL: process.env.GATSBY_TIMEINTERVALSINCE1970_API_URL,
|
|
64
|
+
ABLY_API_KEY: process.env.GATSBY_ABLY_API_KEY,
|
|
65
|
+
GOOGLE_TAGMANAGER_ID: process.env.GATSBY_GOOGLE_TAGMANAGER_ID,
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
export const getEnvVariable = (name) => {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
let res = typeof window === "object" ? window[name] : null;
|
|
70
|
+
if (!res) {
|
|
71
|
+
res = processEnv[name];
|
|
72
|
+
}
|
|
73
|
+
return res;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
if (typeof window ===
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
76
|
+
if (typeof window === "object") {
|
|
77
|
+
window.SITE_URL = processEnv[SITE_URL];
|
|
78
|
+
window.OAUTH2_FLOW = processEnv[OAUTH2_FLOW];
|
|
79
|
+
window.OAUTH2_CLIENT_ID = processEnv[OAUTH2_CLIENT_ID];
|
|
80
|
+
window.SCOPES = processEnv[SCOPES];
|
|
81
|
+
window.IDP_BASE_URL = processEnv[IDP_BASE_URL];
|
|
82
|
+
window.SUMMIT_API_BASE_URL = processEnv[SUMMIT_API_BASE_URL];
|
|
83
|
+
window.API_BASE_URL = processEnv[API_BASE_URL];
|
|
84
|
+
window.SUMMIT_ID = processEnv[SUMMIT_ID];
|
|
85
|
+
window.MARKETING_API_BASE_URL = processEnv[MARKETING_API_BASE_URL];
|
|
86
|
+
window.REGISTRATION_BASE_URL = processEnv[REGISTRATION_BASE_URL];
|
|
87
|
+
window.AUTHZ_USER_GROUPS = processEnv[AUTHZ_USER_GROUPS];
|
|
88
|
+
window.AUTHORIZED_DEFAULT_PATH = processEnv[AUTHORIZED_DEFAULT_PATH];
|
|
89
|
+
window.STREAM_IO_API_KEY = processEnv[STREAM_IO_API_KEY];
|
|
90
|
+
window.MUX_ENV_KEY = processEnv[MUX_ENV_KEY];
|
|
91
|
+
window.DISQUS_SHORTNAME = processEnv[DISQUS_SHORTNAME];
|
|
92
|
+
window.SUPABASE_URL = processEnv[SUPABASE_URL];
|
|
93
|
+
window.SUPABASE_KEY = processEnv[SUPABASE_KEY];
|
|
94
|
+
window.CHAT_API_BASE_URL = processEnv[CHAT_API_BASE_URL];
|
|
95
|
+
window.SCHEDULE_EXCLUDING_TAGS = processEnv[SCHEDULE_EXCLUDING_TAGS];
|
|
96
|
+
window.LIVE_EVENT_THUMBNAIL_GIF_CAPTURE_STARTS = processEnv[LIVE_EVENT_THUMBNAIL_GIF_CAPTURE_STARTS];
|
|
97
|
+
window.SUPPORT_EMAIL = processEnv[SUPPORT_EMAIL];
|
|
98
|
+
window.WS_PUB_SERVER_URL = processEnv[WS_PUB_SERVER_URL];
|
|
99
|
+
window.REAL_TIME_UPDATES_STRATEGY = processEnv[REAL_TIME_UPDATES_STRATEGY];
|
|
100
|
+
window.TIMEINTERVALSINCE1970_API_URL = processEnv[TIMEINTERVALSINCE1970_API_URL];
|
|
101
|
+
window.ABLY_API_KEY = processEnv[ABLY_API_KEY];
|
|
102
|
+
window.GOOGLE_TAGMANAGER_ID = processEnv[GOOGLE_TAGMANAGER_ID];
|
|
103
103
|
}
|
package/src/utils/filePath.js
CHANGED
|
@@ -7,7 +7,7 @@ const CONTENT_PAGES_DIR_PATH = `${PAGES_DIR_PATH}/${CONTENT_PAGES_PATH_NAME}`;
|
|
|
7
7
|
const STYLES_DIR_PATH = "src/styles";
|
|
8
8
|
const DEFAULT_COLORS_FILE_PATH = `${DEFAULTS_DIR_PATH}/colors.json`;
|
|
9
9
|
const COLORS_FILE_PATH = `${DATA_DIR_PATH}/colors.json`;
|
|
10
|
-
const
|
|
10
|
+
const COLORS_SCSS_FILE_PATH = `${STYLES_DIR_PATH}/colors.scss`
|
|
11
11
|
const FONTS_SCSS_FILE_PATH = `${STYLES_DIR_PATH}/fonts.scss`;
|
|
12
12
|
const SITE_SETTINGS_DIR_PATH = `${STATIC_CONTENT_DIR_PATH}/site-settings`;
|
|
13
13
|
const SITE_SETTINGS_FILE_PATH = `${SITE_SETTINGS_DIR_PATH}/index.json`;
|
|
@@ -63,7 +63,7 @@ exports.CONTENT_PAGES_PATH_NAME = CONTENT_PAGES_PATH_NAME;
|
|
|
63
63
|
exports.CONTENT_PAGES_DIR_PATH = CONTENT_PAGES_DIR_PATH;
|
|
64
64
|
exports.DEFAULT_COLORS_FILE_PATH = DEFAULT_COLORS_FILE_PATH;
|
|
65
65
|
exports.COLORS_FILE_PATH = COLORS_FILE_PATH;
|
|
66
|
-
exports.
|
|
66
|
+
exports.COLORS_SCSS_FILE_PATH = COLORS_SCSS_FILE_PATH;
|
|
67
67
|
exports.FONTS_SCSS_FILE_PATH = FONTS_SCSS_FILE_PATH;
|
|
68
68
|
exports.SITE_SETTINGS_DIR_PATH = SITE_SETTINGS_DIR_PATH;
|
|
69
69
|
exports.SITE_SETTINGS_FILE_PATH = SITE_SETTINGS_FILE_PATH;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
const path = require("path");
|
|
2
|
+
const fs = require("fs");
|
|
3
|
+
|
|
4
|
+
const basePackageDir = path.resolve(__dirname, "../..");
|
|
5
|
+
|
|
6
|
+
const { DEFAULT_COLORS_FILE_PATH } = require("./filePath");
|
|
7
|
+
const DEFAULT_COLORS_DATA = require(path.join(basePackageDir, DEFAULT_COLORS_FILE_PATH));
|
|
8
|
+
|
|
9
|
+
const generateAndWriteScssFile = (generatorFn, data, outputPath) => {
|
|
10
|
+
if (!data || Object.keys(data).length === 0) {
|
|
11
|
+
console.error(`No data provided for SCSS file generation at ${outputPath}.`);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const scssFileContent = generatorFn(data);
|
|
15
|
+
if (!scssFileContent) {
|
|
16
|
+
console.error(`Failed to generate content for ${outputPath} SCSS file.`);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
// since files are autogenerated, always write them in package scope
|
|
21
|
+
outputPath = path.join(basePackageDir, outputPath);
|
|
22
|
+
fs.writeFileSync(outputPath, scssFileContent);
|
|
23
|
+
console.log(`SCSS file generated successfully at ${outputPath}`);
|
|
24
|
+
} catch (err) {
|
|
25
|
+
console.error(`Error writing SCSS file: ${err.message}`);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const getFontFormat = (format) => {
|
|
30
|
+
const formatMap = {
|
|
31
|
+
"ttf": "format(\"truetype\")",
|
|
32
|
+
"otf": "format(\"opentype\")",
|
|
33
|
+
"woff": "format(\"woff\")",
|
|
34
|
+
"woff2": "format(\"woff2\")",
|
|
35
|
+
};
|
|
36
|
+
return formatMap[format] || "";
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const getFontSrc = (fontPath) => fontPath.replace(/^\/static/, "");
|
|
40
|
+
|
|
41
|
+
const generateFontFace = (fontFamily, fontData, fontWeight) => {
|
|
42
|
+
if (!fontFamily || !fontData || !fontData.fontFile || !fontData.fontFormat) return "";
|
|
43
|
+
|
|
44
|
+
const { fontFile, fontFormat } = fontData;
|
|
45
|
+
return `@font-face {
|
|
46
|
+
font-family: "${fontFamily}";
|
|
47
|
+
src: url("${getFontSrc(fontFile)}") ${getFontFormat(fontFormat)};
|
|
48
|
+
font-weight: ${fontWeight};
|
|
49
|
+
}`;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const generateFontScssFile = (fontsData) => {
|
|
53
|
+
if (!fontsData || !fontsData.fontFamily || !fontsData.regularFont || !fontsData.boldFont) return null;
|
|
54
|
+
|
|
55
|
+
const { fontFamily, regularFont, boldFont } = fontsData;
|
|
56
|
+
|
|
57
|
+
if (!regularFont.fontFile || !regularFont.fontFormat) return null;
|
|
58
|
+
if (!boldFont.fontFile || !boldFont.fontFormat) return null;
|
|
59
|
+
|
|
60
|
+
const regularFontFace = generateFontFace(fontFamily, regularFont, "normal");
|
|
61
|
+
const boldFontFace = generateFontFace(fontFamily, boldFont, "bold");
|
|
62
|
+
|
|
63
|
+
return `$font-family: "${fontFamily}";
|
|
64
|
+
|
|
65
|
+
:root {
|
|
66
|
+
--font_family: "${fontFamily}" !important;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
${regularFontFace}
|
|
70
|
+
${boldFontFace}
|
|
71
|
+
|
|
72
|
+
%font-regular {
|
|
73
|
+
font-family: var(--font_family);
|
|
74
|
+
font-weight: 400;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
%font-semi {
|
|
78
|
+
font-family: var(--font_family);
|
|
79
|
+
font-weight: 600;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
%font-bold {
|
|
83
|
+
font-family: var(--font_family);
|
|
84
|
+
font-weight: 700;
|
|
85
|
+
}`;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const generateColorsScssFile = (colorsData) => {
|
|
89
|
+
const mergedColorsData = { ...DEFAULT_COLORS_DATA, ...colorsData };
|
|
90
|
+
|
|
91
|
+
let colorVars = "";
|
|
92
|
+
for (const [key, value] of Object.entries(mergedColorsData)) {
|
|
93
|
+
colorVars += `$${key}: ${value};\n`;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const rootColors = `
|
|
97
|
+
:root {
|
|
98
|
+
--color_primary: #{$color_primary};
|
|
99
|
+
--color_primary_contrast: #{$color_primary_contrast};
|
|
100
|
+
--color_secondary: #{$color_secondary};
|
|
101
|
+
--color_secondary_contrast: #{$color_secondary_contrast};
|
|
102
|
+
--color_text_dark: #{$color_text_dark};
|
|
103
|
+
--color_text_med: #{$color_text_med};
|
|
104
|
+
--color_text_light: #{$color_text_light};
|
|
105
|
+
--color_background_light: #{$color_background_light};
|
|
106
|
+
--color_background_dark: #{$color_background_dark};
|
|
107
|
+
--color_gray_darker: #{$color_gray_darker};
|
|
108
|
+
--color_gray_dark: #{$color_gray_dark};
|
|
109
|
+
--color_gray_light: #{$color_gray_light};
|
|
110
|
+
--color_gray_lighter: #{$color_gray_lighter};
|
|
111
|
+
--color_input_text_color: #{$color_input_text_color_light};
|
|
112
|
+
--color_input_background_color: #{$color_input_background_color_light};
|
|
113
|
+
--color_input_border_color: #{$color_input_border_color_light};
|
|
114
|
+
--color_text_input_hints: #{$color_text_input_hints_light};
|
|
115
|
+
--color_horizontal_rule: #{$color_horizontal_rule_light};
|
|
116
|
+
--color_icon_light: #{$color_icon_light};
|
|
117
|
+
--color_button_background_color: #{$color_button_background_color};
|
|
118
|
+
--color_button_color: #{$color_button_color};
|
|
119
|
+
--color_alerts: #{$color_alerts};
|
|
120
|
+
}`;
|
|
121
|
+
|
|
122
|
+
const darkThemeColors = `
|
|
123
|
+
html[data-theme="DARK"] {
|
|
124
|
+
--color_text_dark: #{$color_text_light} !important;
|
|
125
|
+
--color_text_light: #{$color_text_dark} !important;
|
|
126
|
+
--color_background_light: #{$color_background_dark} !important;
|
|
127
|
+
--color_background_dark: #{$color_background_light} !important;
|
|
128
|
+
--color_gray_darker: #{$color_gray_lighter} !important;
|
|
129
|
+
--color_gray_dark: #{$color_gray_light} !important;
|
|
130
|
+
--color_gray_light: #{$color_gray_dark} !important;
|
|
131
|
+
--color_gray_lighter: #{$color_gray_darker} !important;
|
|
132
|
+
--color_input_text_color: #{$color_input_text_color_dark} !important;
|
|
133
|
+
--color_input_background_color: #{$color_input_background_color_dark} !important;
|
|
134
|
+
--color_input_border_color: #{$color_input_border_color_dark} !important;
|
|
135
|
+
--color_text_input_hints: #{$color_text_input_hints_dark} !important;
|
|
136
|
+
--color_horizontal_rule: #{$color_horizontal_rule_dark} !important;
|
|
137
|
+
}`;
|
|
138
|
+
|
|
139
|
+
return `${colorVars}${rootColors}${darkThemeColors}`;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
module.exports = {
|
|
143
|
+
generateAndWriteScssFile,
|
|
144
|
+
generateFontScssFile,
|
|
145
|
+
generateColorsScssFile
|
|
146
|
+
};
|
package/src/utils/cssUtils.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
const getFontFormat = (format) => {
|
|
2
|
-
const formatMap = {
|
|
3
|
-
"ttf": "format(\"truetype\")",
|
|
4
|
-
"otf": "format(\"opentype\")",
|
|
5
|
-
"woff": "format(\"woff\")",
|
|
6
|
-
"woff2": "format(\"woff2\")",
|
|
7
|
-
};
|
|
8
|
-
return formatMap[format] || "";
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const getFontSrc = (fontPath) => fontPath.replace(/^\/static/, "");
|
|
12
|
-
|
|
13
|
-
const generateFontFace = (fontFamily, fontData, fontWeight) => {
|
|
14
|
-
if (!fontFamily || !fontData || !fontData.fontFile || !fontData.fontFormat) return "";
|
|
15
|
-
|
|
16
|
-
const { fontFile, fontFormat } = fontData;
|
|
17
|
-
return `@font-face {
|
|
18
|
-
font-family: "${fontFamily}";
|
|
19
|
-
src: url("${getFontSrc(fontFile)}") ${getFontFormat(fontFormat)};
|
|
20
|
-
font-weight: ${fontWeight};
|
|
21
|
-
}`;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const generateFontFile = (fontsData) => {
|
|
25
|
-
if (!fontsData || !fontsData.fontFamily || !fontsData.regularFont || !fontsData.boldFont) return null;
|
|
26
|
-
|
|
27
|
-
const { fontFamily, regularFont, boldFont } = fontsData;
|
|
28
|
-
|
|
29
|
-
if (!regularFont.fontFile || !regularFont.fontFormat) return null;
|
|
30
|
-
if (!boldFont.fontFile || !boldFont.fontFormat) return null;
|
|
31
|
-
|
|
32
|
-
const regularFontFace = generateFontFace(fontFamily, regularFont, "normal");
|
|
33
|
-
const boldFontFace = generateFontFace(fontFamily, boldFont, "bold");
|
|
34
|
-
|
|
35
|
-
return `$font-family: "${fontFamily}";
|
|
36
|
-
|
|
37
|
-
:root {
|
|
38
|
-
--font_family: "${fontFamily}" !important;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
${regularFontFace}
|
|
42
|
-
${boldFontFace}
|
|
43
|
-
|
|
44
|
-
%font-regular {
|
|
45
|
-
font-family: var(--font_family);
|
|
46
|
-
font-weight: 400;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
%font-semi {
|
|
50
|
-
font-family: var(--font_family);
|
|
51
|
-
font-weight: 600;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
%font-bold {
|
|
55
|
-
font-family: var(--font_family);
|
|
56
|
-
font-weight: 700;
|
|
57
|
-
}`;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
module.exports = {
|
|
61
|
-
generateFontFile
|
|
62
|
-
};
|