diff --git a/src/core/components/layout-utils.jsx b/src/core/components/layout-utils.jsx deleted file mode 100644 index 6879d83ed25..00000000000 --- a/src/core/components/layout-utils.jsx +++ /dev/null @@ -1,272 +0,0 @@ -import React from "react" -import PropTypes from "prop-types" - -function xclass(...args) { - return args.filter(a => !!a).join(" ").trim() -} - -export class Container extends React.Component { - render() { - let { fullscreen, full, ...rest } = this.props - // Normal element - - if(fullscreen) - return
- - let containerClass = "swagger-container" + (full ? "-full" : "") - return ( -
- ) - } -} - -Container.propTypes = { - fullscreen: PropTypes.bool, - full: PropTypes.bool, - className: PropTypes.string -} - -const DEVICES = { - "mobile": "", - "tablet": "-tablet", - "desktop": "-desktop", - "large": "-hd" -} - -export class Col extends React.Component { - - render() { - const { - hide, - keepContents, - /* we don't want these in the `rest` object that passes to the final component, - since React now complains. So we extract them */ - /* eslint-disable no-unused-vars */ - mobile, - tablet, - desktop, - large, - /* eslint-enable no-unused-vars */ - ...rest - } = this.props - - if(hide && !keepContents) - return - - let classesAr = [] - - for (let device in DEVICES) { - if (!DEVICES.hasOwnProperty(device)) { - continue - } - let deviceClass = DEVICES[device] - if(device in this.props) { - let val = this.props[device] - - if(val < 1) { - classesAr.push("none" + deviceClass) - continue - } - - classesAr.push("block" + deviceClass) - classesAr.push("col-" + val + deviceClass) - } - } - - let classes = xclass(rest.className, ...classesAr) - - return ( -
- ) - } - -} - -Col.propTypes = { - hide: PropTypes.bool, - keepContents: PropTypes.bool, - mobile: PropTypes.number, - tablet: PropTypes.number, - desktop: PropTypes.number, - large: PropTypes.number, - className: PropTypes.string -} - -export class Row extends React.Component { - - render() { - return
- } - -} - -Row.propTypes = { - className: PropTypes.string -} - -export class Button extends React.Component { - - static propTypes = { - className: PropTypes.string, - unstyled: PropTypes.bool, - mod: PropTypes.string - } - - static defaultProps = { - className: "", - unstyled: false, - mod: "primary" - } - - defaultClasses = ({ unstyled, mod }) => !unstyled ? `sui-btn sui-btn--${mod}` : "" - - render() { - const { unstyled, mod, className, ...props } = this.props - - return ( -