Skip to content

Commit

Permalink
iframe loaded only when an example is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmaguitar committed Aug 30, 2024
1 parent 62b2c0b commit e2a1f4e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions _app/src/HomePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,13 @@ const Examples = () => {
<_DataViews />
</div>
<div className="iframeContainer">
<iframe
src={ `https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/WordPress/block-development-examples/trunk/plugins/${ selectedExample }/_playground/blueprint.json` }
title="Example Iframe" // Title for accessibility
loading="lazy" // Optional: Defer loading the iframe until it is visible
/>
{ selectedExample && (
<iframe
src={ `https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/WordPress/block-development-examples/trunk/plugins/${ selectedExample }/_playground/blueprint.json` }
title="Example Iframe" // Title for accessibility
loading="lazy" // Optional: Defer loading the iframe until it is visible
/>
) }
</div>
</div>
) : (
Expand Down

0 comments on commit e2a1f4e

Please sign in to comment.