mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-15 08:59:15 +08:00
f4411d9393
* refactor: Steps cssInJs add basic structure * refactor: change Component Steps less into cssInJs * refactor: ♻️ steps cssInJs code formated * style: 💄 change Steps cssinjs left and right into Logical Properties * style: 💄 steps cssinjs add FIXME for number hardcode * style: 💄 steps cssinjs dismiss useless rtl style * style: 💄 step cssinjs fix the 'not compatible with RTL mode' warning and fix the style in RTL mode * style: code formated for FIXME * style: revert the change about _skip_check_ * style: step cssinjs margin/padding used with Logical properties * ci: fix lint check * style: fix the style on RTL * style: try fix the step subtitle order on RTL mode * style: optimization the style on RTL and dismiss duplicate styles with logical properties
36 lines
716 B
TypeScript
36 lines
716 B
TypeScript
import React, { FC } from 'react';
|
|
|
|
type DiffProps = {
|
|
show: boolean;
|
|
};
|
|
|
|
const Diff: FC<DiffProps> = ({ show }) => {
|
|
if (typeof window === 'undefined') {
|
|
return null;
|
|
}
|
|
|
|
const src = window.location.href.replace(/(https?:\/\/)[^/]+/, '$1ant.design');
|
|
|
|
return (
|
|
<iframe
|
|
title="master-diff"
|
|
style={{
|
|
position: 'absolute',
|
|
width: document.body.scrollWidth,
|
|
// width: `calc(100vw - 15px)`,
|
|
// width: '100vw',
|
|
height: document.body.scrollHeight,
|
|
top: 0,
|
|
left: 0,
|
|
pointerEvents: 'none',
|
|
opacity: show ? '30%' : '0',
|
|
zIndex: 10,
|
|
}}
|
|
src={src}
|
|
frameBorder={0}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default Diff;
|