Skip to content

Commit

Permalink
Merge branch 'develop' into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasio committed Apr 22, 2024
2 parents e3279d5 + 66031ec commit 7d61c7c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .changeset/fuzzy-bees-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@headstartwp/core": patch
---

Pass params attr to YoutubeLiteBlock
22 changes: 11 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion packages/core/src/react/blocks/YoutubeLiteBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ declare global {
export interface YoutubeLiteBlockProps extends IBlockAttributes {
src: string;
title: string;
params?: string;
}

export interface IYoutubeLiteBlock extends IBlock<YoutubeLiteBlockProps> {}
Expand Down Expand Up @@ -55,10 +56,14 @@ export function YoutubeLiteBlock({ domNode }: Omit<IYoutubeLiteBlock, 'component
}
}

const { src, title } = attribs;
const { src, title, params } = attribs;

const videoId = src.match(youtubeEmbedRegex)?.[7];

if (params) {
return <lite-youtube videoid={videoId} videotitle={title} params={params} />;
}

return <lite-youtube videoid={videoId} videotitle={title} />;
}

Expand Down

0 comments on commit 7d61c7c

Please sign in to comment.