Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EuiCodeBlock] Minimize subcomponent remounting #6077

Merged
merged 7 commits into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 67 additions & 86 deletions src/components/code/__snapshots__/code_block.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -85,54 +85,41 @@ exports[`EuiCodeBlock fullscreen displays content in fullscreen mode 1`] = `
<div
className="euiCodeBlock__controls"
>
<FullScreenButton>
<EuiI18n
defaults={
Array [
"Collapse",
"Expand",
]
}
tokens={
Array [
"euiCodeBlock.fullscreenCollapse",
"euiCodeBlock.fullscreenExpand",
]
}
>
<EuiButtonIcon
<FullScreenButton
isFullScreen={true}
toggleFullScreen={[Function]}
>
<EuiButtonIcon
aria-label="Collapse"
className="euiCodeBlock__fullScreenButton"
color="text"
iconType="fullScreenExit"
onClick={[Function]}
>
<button
aria-label="Collapse"
className="euiCodeBlock__fullScreenButton"
color="text"
iconType="fullScreenExit"
className="euiButtonIcon euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--xSmall euiCodeBlock__fullScreenButton"
onClick={[Function]}
type="button"
>
<button
aria-label="Collapse"
className="euiButtonIcon euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--xSmall euiCodeBlock__fullScreenButton"
onClick={[Function]}
type="button"
<EuiIcon
aria-hidden="true"
className="euiButtonIcon__icon"
color="inherit"
size="m"
type="fullScreenExit"
>
<EuiIcon
<span
aria-hidden="true"
className="euiButtonIcon__icon"
color="inherit"
data-euiicon-type="fullScreenExit"
size="m"
type="fullScreenExit"
>
<span
aria-hidden="true"
className="euiButtonIcon__icon"
color="inherit"
data-euiicon-type="fullScreenExit"
size="m"
/>
</EuiIcon>
</button>
</EuiButtonIcon>
</EuiI18n>
/>
</EuiIcon>
</button>
</EuiButtonIcon>
</FullScreenButton>
<CopyButton />
</div>
</div>
`;
Expand Down Expand Up @@ -412,74 +399,68 @@ exports[`EuiCodeBlock props isCopyable is rendered 1`] = `
<div
className="euiCodeBlock__controls"
>
<FullScreenButton />
<CopyButton>
<CopyButton
textToCopy="var some = 'code';
console.log(some);"
>
<div
className="euiCodeBlock__copyButton"
>
<EuiI18n
default="Copy"
token="euiCodeBlock.copyButton"
>
<EuiCopy
afterMessage="Copied"
textToCopy="var some = 'code';
<EuiCopy
afterMessage="Copied"
textToCopy="var some = 'code';
console.log(some);"
>
<EuiToolTip
delay="regular"
display="inlineBlock"
onMouseOut={[Function]}
position="top"
>
<EuiToolTip
delay="regular"
display="inlineBlock"
<span
className="euiToolTipAnchor"
onMouseOut={[Function]}
position="top"
onMouseOver={[Function]}
>
<span
className="euiToolTipAnchor"
onMouseOut={[Function]}
onMouseOver={[Function]}
<EuiButtonIcon
aria-label="Copy"
color="text"
iconType="copyClipboard"
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
>
<EuiButtonIcon
<button
aria-label="Copy"
color="text"
iconType="copyClipboard"
className="euiButtonIcon euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--xSmall"
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
type="button"
>
<button
aria-label="Copy"
className="euiButtonIcon euiButtonIcon--text euiButtonIcon--empty euiButtonIcon--xSmall"
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
type="button"
<EuiIcon
aria-hidden="true"
className="euiButtonIcon__icon"
color="inherit"
size="m"
type="copyClipboard"
>
<EuiIcon
<span
aria-hidden="true"
className="euiButtonIcon__icon"
color="inherit"
data-euiicon-type="copyClipboard"
size="m"
type="copyClipboard"
>
<span
aria-hidden="true"
className="euiButtonIcon__icon"
color="inherit"
data-euiicon-type="copyClipboard"
size="m"
/>
</EuiIcon>
</button>
</EuiButtonIcon>
</span>
</EuiToolTip>
</EuiCopy>
</EuiI18n>
/>
</EuiIcon>
</button>
</EuiButtonIcon>
</span>
</EuiToolTip>
</EuiCopy>
</div>
</CopyButton>
</div>
<FullScreenDisplay
className="euiCodeBlock euiCodeBlock--hasControl"
/>
</div>
</EuiCodeBlock>
`;
Expand Down
Loading