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

UI: Fix display=true warning in console #25951

Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion code/ui/manager/src/components/preview/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const Preview = React.memo<PreviewProps>(function Preview(props) {
/>
<S.FrameWrap key="frame">
{tabContent && <S.IframeWrapper>{tabContent({ active: true })}</S.IframeWrapper>}
<S.CanvasWrap display={!tabId}>
<S.CanvasWrap show={!tabId}>
<Canvas {...{ withLoader, baseUrl }} wrappers={wrappers} />
</S.CanvasWrap>
</S.FrameWrap>
Expand Down
5 changes: 2 additions & 3 deletions code/ui/manager/src/components/preview/utils/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,20 @@ export const FrameWrap = styled.div({
background: 'transparent',
flex: 1,
});
export const CanvasWrap = styled.div<{ display: boolean }>(
export const CanvasWrap = styled.div<{ show: boolean }>(
{
alignContent: 'center',
alignItems: 'center',
justifyContent: 'center',
justifyItems: 'center',
overflow: 'auto',
display: 'grid',
gridTemplateColumns: '100%',
gridTemplateRows: '100%',
position: 'relative',
width: '100%',
height: '100%',
},
({ display }) => (display ? {} : { display: 'none' })
({ show }) => ({ display: show ? 'grid' : 'none' })
);

export const UnstyledLink = styled(Link)({
Expand Down
Loading