Beispiel #1
0
export const JsonOverlay = ({ value, className }) => {
  const style = {
    zIndex: '2',
    fontFamily: 'monospace',
    border: 'none',
    backgroundColor: 'transparent',
    pointerEvents: 'none',
  }
  return (
    <div style={style} className={className}>
      {formatter(value)}
    </div>
  )
};
Beispiel #2
0
const TextOverlay = ({ value, scrollTop, scrollLeft, offsetWidth, caret, className }) => {
  const style = {
    position: 'absolute',
    top: `${0 - scrollTop}px`,
    zIndex: '2',
    left: `${0 - scrollLeft}px`,
    fontFamily: 'monospace',
    border: 'none',
    backgroundColor: 'transparent',
    pointerEvents: 'none',
    width: offsetWidth,
  }
  return (
    <div style={style} className={className}>
      {formatter(value, caret)}
    </div>
  )
}