Skip to content

Commit

Permalink
feat: add teaser video configuration to CMS
Browse files Browse the repository at this point in the history
  • Loading branch information
tyhonchik committed Feb 6, 2025
1 parent 86b86ee commit 6999065
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 0 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
1 change: 1 addition & 0 deletions features/cms/initialize/collections/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ export * from "./banners/banners";
export * from "./stethInDefiConfig/stethInDefiConfig";
export * from "./stethInDefiProject/stethInDefiProject";
export * from "./multichainProjects/multichainProjects";
export * from "./teaserVideo/teaserVideo";
99 changes: 99 additions & 0 deletions features/cms/initialize/collections/teaserVideo/teaserVideo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import type { CmsCollection, CmsField } from "netlify-cms-core";

export const teaserVideo: CmsCollection = {
name: "teaser-video",
label: "Teaser Video",
editor: {
preview: false,
},
files: [
{
name: "teaser-video-config",
label: "Teaser Video Configuration",
description:
"Configuration for video iframe settings used in different environments",
file: "lido-landing/teaser-video.md",
fields: [
{
name: "info",
label: "Information",
widget: "info",
required: false,
data: [
{
description:
"This configuration allows you to manage video settings and backup link behavior for testnet and production environments.",
},
],
} as unknown as CmsField,
{
name: "testnet-useIframeVideo",
label: "Enable Video (Testnet)",
widget: "boolean",
default: false,
required: false,
hint: "Toggle to enable/disable iframe video in testnet environment",
},
{
name: "testnet-iframeVideoCode",
label: "Video Embed Code (Testnet)",
widget: "text",
required: false,
hint: "Paste the iframe HTML code from YouTube or other video platforms. Used when video is enabled.",
},
{
name: "testnet-useBackupLink",
label: "Use Backup Link Instead of Video (Testnet)",
widget: "boolean",
default: false,
required: false,
hint: "When enabled, clicking the button will open the backup link in a new tab instead of showing the video",
},
{
name: "testnet-backupLink",
label: "Backup Link (Testnet)",
widget: "string",
required: false,
hint: "URL to open in new tab when backup link mode is enabled",
},
{
name: "production-useIframeVideo",
label: "Enable Video (Production)",
widget: "boolean",
default: false,
required: false,
hint: "Toggle to enable/disable iframe video in production environment",
},
{
name: "production-iframeVideoCode",
label: "Video Embed Code (Production)",
widget: "text",
required: false,
hint: "Paste the iframe HTML code from YouTube or other video platforms. Used when video is enabled.",
},
{
name: "production-useBackupLink",
label: "Use Backup Link Instead of Video (Production)",
widget: "boolean",
default: false,
required: false,
hint: "When enabled, clicking the button will open the backup link in a new tab instead of showing the video",
},
{
name: "production-backupLink",
label: "Backup Link (Production)",
widget: "string",
required: false,
hint: "URL to open in new tab when backup link mode is enabled",
},
{
name: "body",
label: "Documentation",
widget: "markdown",
required: false,
hint: "Additional documentation and usage instructions",
},
],
},
],
};
2 changes: 2 additions & 0 deletions features/cms/initialize/initialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
stethInDefiProject,
stethInDefiConfig,
multichainProjects,
teaserVideo,
} from "./collections";

const { publicRuntimeConfig } = getConfig();
Expand Down Expand Up @@ -39,6 +40,7 @@ export const initializeCMS = () => {
stethInDefiProject,
stethInDefiConfig,
multichainProjects,
teaserVideo,
],
},
});
Expand Down

0 comments on commit 6999065

Please sign in to comment.