Skip to content

Commit

Permalink
Playground block: Distinguish better between Run and Activate buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonpayton committed Jun 18, 2024
1 parent 1a47ce4 commit 3b12c68
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,14 @@ export default function PlaygroundPreview({
'is-one-under-another': !codeEditorSideBySide,
'is-side-by-side': codeEditorSideBySide,
});
const iframeCreationWarning =
'This button creates an iframe containing a full WordPress website ' +
'which may be a challenge for screen readers.';
const iframeCreationWarningForRunningCode =
'This button runs the code in the Preview iframe. ' +
'If the Preview iframe has not yet been activated, this ' +
'button creates the Preview iframe which contains a full ' +
'WordPress website and may be a challenge for screen readers.';
const iframeCreationWarningForActivation =
'This button creates the Preview iframe containing a full ' +
'WordPress website which may be a challenge for screen readers.';

return (
<>
Expand Down Expand Up @@ -508,7 +513,7 @@ export default function PlaygroundPreview({
className="wordpress-playground-run-button"
aria-description={
requireLivePreviewActivation
? iframeCreationWarning
? iframeCreationWarningForRunningCode
: undefined
}
>
Expand Down Expand Up @@ -539,7 +544,9 @@ export default function PlaygroundPreview({
className="wordpress-playground-activate-button"
variant="primary"
onClick={() => setLivePreviewActivated(true)}
aria-description={iframeCreationWarning}
aria-description={
iframeCreationWarningForActivation
}
>
Activate Live Preview
</Button>
Expand Down

0 comments on commit 3b12c68

Please sign in to comment.