Version 0.9.0-beta.1
·
17 commits
to master
since this release
📺 A lightweight React component package that lets users click a preview image (or any other element like a button) and play a YouTube video inside an overlay.
📗 Test Coverage
PASS src/components/test/main-div.test.tsx
MainDiv
✓ renders visible overlay with children when show is true
✓ renders hidden overlay without children when show is false
✓ renders exactly 2 paragraph children when two paragraphs are provided
PASS src/components/test/close-button.test.tsx
CloseBtn
✓ renders a button with closeIcon class and type button
✓ calls handleOnClick when clicked
PASS src/components/test/frame-component.test.tsx
FrameComponent
✓ renders iframe with provided title
✓ builds src with autoplay, mute, and rel query params
✓ sets allow and allowFullScreen attributes
PASS src/components/test/index.test.tsx
ReactYouTubeOverlay
✓ returns null when embedLink and embedTitle are empty strings
✓ renders overlay content when embedLink and embedTitle are non-empty
✓ changes overlay state when close button is clicked
Test Suites: 4 passed, 4 total
Tests: 11 passed, 11 total
Snapshots: 0 total
----------------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------------------|---------|----------|---------|---------|-------------------
All files | 100 | 100 | 100 | 100 |
components | 100 | 100 | 100 | 100 |
close-button.tsx | 100 | 100 | 100 | 100 |
frame-component.tsx | 100 | 100 | 100 | 100 |
index.tsx | 100 | 100 | 100 | 100 |
main-div.tsx | 100 | 100 | 100 | 100 |
hooks | 100 | 100 | 100 | 100 |
use-overlay.ts | 100 | 100 | 100 | 100 |
----------------------|---------|----------|---------|---------|-------------------
Package NPM Released: https://www.npmjs.com/package/react-click-image-play-youtube-video