Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/ui / src / components / atoms / IFrame / IFrame.tsx
Size: Mime:
import React from 'react'
import { StyledIFrame, StyledIFrameWrap } from './styled'
import { IframeProps } from './typings'

class IFrame extends React.PureComponent<IframeProps> {
  static defaultProps = {
    src: '',
    layout: 'responsive',
    sandbox: 'allow-scripts allow-same-origin allow-popups',
    frameBorder: '0',
    width: '70%',
    height: '500px',
    nowrap: false,
  }

  render() {
    const { width, height, nowrap, ...remainingProps } = this.props
    const wrapperProps = { width, height }

    if (nowrap === true) {
      return <StyledIFrame {...remainingProps} />
    } else {
      return (
        <StyledIFrameWrap {...wrapperProps}>
          <StyledIFrame {...remainingProps} />
        </StyledIFrameWrap>
      )
    }
  }
}

export { IFrame }
export default IFrame