From a26293d1e0c3d4be5ee7966ea74c6f74d694d5e6 Mon Sep 17 00:00:00 2001 From: PedroBailaAndrade Date: Fri, 22 Dec 2023 15:40:14 +0000 Subject: [PATCH 01/10] Add VideoSectionBlock props --- workspaces/cms-config/src/blocks.ts | 14 ++++++++++++++ workspaces/cms-data/src/pages.ts | 2 ++ .../website/src/blocks/VideoSectionBlock.tsx | 7 +++++-- .../src/components/CategoryTabs/CategoryTabs.tsx | 3 +++ 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/workspaces/cms-config/src/blocks.ts b/workspaces/cms-config/src/blocks.ts index a985890f5e..7735dedaa7 100644 --- a/workspaces/cms-config/src/blocks.ts +++ b/workspaces/cms-config/src/blocks.ts @@ -692,6 +692,20 @@ export const blocks = [ label: "Education video section", widget: "object", fields: [ + { + label: "Chapter description full width", + name: "chapterDescriptionFullWidth", + widget: "boolean", + default: false, + required: false, + }, + { + label: "Chapters playlist on bottom of video desktop", + name: "playlistOnBottom", + widget: "boolean", + default: true, + required: false, + }, { crowdin: true, label: 'Chapter 1', diff --git a/workspaces/cms-data/src/pages.ts b/workspaces/cms-data/src/pages.ts index 642022439e..3efe2ab66d 100644 --- a/workspaces/cms-data/src/pages.ts +++ b/workspaces/cms-data/src/pages.ts @@ -158,6 +158,8 @@ export interface VideoSectionBlock { readonly sequencer: ChapterInfo; readonly prover: ChapterInfo; readonly 'eth-settlement': ChapterInfo; + readonly chapterDescriptionFullWidth: boolean; + readonly playlistOnBottom: boolean; } export interface NewsletterBlock { diff --git a/workspaces/website/src/blocks/VideoSectionBlock.tsx b/workspaces/website/src/blocks/VideoSectionBlock.tsx index f429631ea6..116dad237c 100644 --- a/workspaces/website/src/blocks/VideoSectionBlock.tsx +++ b/workspaces/website/src/blocks/VideoSectionBlock.tsx @@ -26,6 +26,8 @@ type ChapterType = Chapter & ChapterInfo; */ export default function VideoSectionBlock(props: VideoSectionProps) { + const { playlistOnBottom, chapterDescriptionFullWidth } = props; + const normalizedPlaylist = useMemo(() => { return playlist.map((chapter) => { const chapterInfo = props[chapter.id as keyof VideoSectionProps] as ChapterInfo; @@ -55,7 +57,7 @@ export default function VideoSectionBlock(props: VideoSectionProps) { onChapterChange={(id) => setCurrentChapter(normalizedPlaylist.find((p) => p.id === id) ?? normalizedPlaylist[0]) } - playlistOnBottom + playlistOnBottom={playlistOnBottom} /> @@ -68,10 +70,11 @@ export default function VideoSectionBlock(props: VideoSectionProps) { id: p.id, label: p.subtitle, }))} + playlistOnBottom={playlistOnBottom} /> diff --git a/workspaces/website/src/components/CategoryTabs/CategoryTabs.tsx b/workspaces/website/src/components/CategoryTabs/CategoryTabs.tsx index 8c7742c31a..27413401d7 100644 --- a/workspaces/website/src/components/CategoryTabs/CategoryTabs.tsx +++ b/workspaces/website/src/components/CategoryTabs/CategoryTabs.tsx @@ -24,6 +24,7 @@ export type CategoryTabsProps = { items: CategoryTabItem[]; activeItemId: string; onTabClick?: (id: string) => void; + playlistOnBottom: boolean; }; /** @@ -34,12 +35,14 @@ export const CategoryTabs = ({ items, activeItemId, onTabClick, + playlistOnBottom, }: CategoryTabsProps) => { return ( Date: Fri, 22 Dec 2023 15:41:21 +0000 Subject: [PATCH 02/10] Update what is starknet page data --- _data/pages/what-is-starknet.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/_data/pages/what-is-starknet.yml b/_data/pages/what-is-starknet.yml index a5edef05b2..0f9d4ae4bf 100644 --- a/_data/pages/what-is-starknet.yml +++ b/_data/pages/what-is-starknet.yml @@ -5,8 +5,9 @@ page_last_updated: true blocks: - type: page_header title: "What is Starknet? " + description: "" - type: markdown - body: > + body: >- Starknet is a Validity-Rollup (aka ZK-Rollup) Layer 2 network that operates on top of Ethereum, enabling dApps to massively scale without compromising on security. @@ -61,6 +62,8 @@ blocks: The Core contract verifies the proof's authenticity and confirms receiving the State Diff, subsequently updating the Starknet state on the Ethereum blockchain. This updated state is then added to an Ethereum block, distributed across the node network for validation and voting. When the block accumulates sufficient votes, it achieves "finalized" status, cementing its place as an immutable part of Ethereum. title: Secure Settlement on Ethereum description: Chapter 4 explains how to secure settlement on Ethereum + chapterDescriptionFullWidth: true + playlistOnBottom: false - type: link_list heading: Further reading listSize: lg From b1e168b586842f57d01491800c01ac76981cc86a Mon Sep 17 00:00:00 2001 From: PedroBailaAndrade Date: Fri, 22 Dec 2023 15:40:51 +0000 Subject: [PATCH 03/10] Add VideoSectionBlock new style --- .../components/CategoryTabs/CategoryTabs.tsx | 4 +- .../player-core/VideoPlayerCore.tsx | 13 ++- .../player-core/control-bar/CustomControl.tsx | 2 + .../player-website/BottomPlaylist.tsx | 6 +- .../player-website/ChaptersPlaylist.tsx | 79 +++++++++++-------- .../player-website/VideoPlayerWebsite.tsx | 2 +- 6 files changed, 61 insertions(+), 45 deletions(-) diff --git a/workspaces/website/src/components/CategoryTabs/CategoryTabs.tsx b/workspaces/website/src/components/CategoryTabs/CategoryTabs.tsx index 27413401d7..21c497bd03 100644 --- a/workspaces/website/src/components/CategoryTabs/CategoryTabs.tsx +++ b/workspaces/website/src/components/CategoryTabs/CategoryTabs.tsx @@ -52,9 +52,9 @@ export const CategoryTabs = ({ width="100%" padding={'0 24px'} > - {items.map((item) => { + {items.map((item, index) => { return ( - +