UNPKG

fk-react-ui-components

Version:

Step 1 : Create a file in [ Seeds / Plants / Trees ] <br> Step 2 : It should export an Object with component name and story Component [Refer other components] <br> Step 3 : Story Component should return a react component <br> Step 3 : Created file should

45 lines (44 loc) 1.6 kB
import React from "react"; import PropTypes from 'prop-types'; import { FlexCell } from "../Layout"; import { Progress, ProgressBar } from "./styles/Timeline"; import { TlHeader, TlBody, Tlfooter } from "./styles/Timeline"; export default class MileStones extends React.Component { shouldComponentUpdate() { return false; } render() { const children = this.props.children; return React.createElement( FlexCell, { className: "milestone " + this.props.status }, React.Children.map(children, (node, i) => { if (node.type === TlHeader) { return node; } if (node.type === TlBody) { return React.createElement( "div", null, React.createElement( Progress, { className: "progress " + this.props.progressBar.borderType, borderColor: this.props.progressBar.color }, React.createElement(ProgressBar, { className: "progress-bar", styles: this.props.progressBar }) ), node ); } if (node.type === Tlfooter) { return node; } }) ); } } MileStones.propTypes = { children: PropTypes.node.isRequired, status: PropTypes.string, progressBar: PropTypes.object, borderColor: PropTypes.string }; //# sourceMappingURL=milestone.js.map