UNPKG

terriajs

Version:

Geospatial data visualization platform.

22 lines 832 B
import { jsx as _jsx } from "react/jsx-runtime"; import createReactClass from "create-react-class"; import PropTypes from "prop-types"; import Icon from "../../Styled/Icon"; const MoreOrLess = createReactClass({ getInitialState: function () { return { isOpen: this.props.initialopen }; }, displayName: "MoreOrLess", propTypes: { initialopen: PropTypes.bool, myclass: PropTypes.string }, toggleIcon: function () { this.setState({ isOpen: !this.state.isOpen }); }, render: function () { return (_jsx("button", { type: "button", onClick: this.toggleIcon, className: this.props.myclass, children: _jsx(Icon, { glyph: this.state.isOpen ? Icon.GLYPHS.showLess : Icon.GLYPHS.showMore }) })); } }); export default MoreOrLess; //# sourceMappingURL=MoreOrLess.js.map