|
| 1 | +/* eslint react/no-multi-comp: 0, react/prop-types: 0 */ |
| 2 | +import React from 'react'; |
| 3 | +import { PrismCode } from 'react-prism'; |
| 4 | +import Helmet from 'react-helmet'; |
| 5 | +import { Card, CardText } from 'reactstrap'; |
| 6 | +import ProgressExample from '../examples/Progress'; |
| 7 | +const ProgressExampleSource = require('!!raw!../examples/Progress.jsx'); |
| 8 | +import ProgressColorExample from '../examples/ProgressColor'; |
| 9 | +const ProgressColorExampleSource = require('!!raw!../examples/ProgressColor.jsx'); |
| 10 | +import ProgressAnimatedExample from '../examples/ProgressAnimated'; |
| 11 | +const ProgressAnimatedExampleSource = require('!!raw!../examples/ProgressAnimated.jsx'); |
| 12 | +import ProgressStripedExample from '../examples/ProgressStriped'; |
| 13 | +const ProgressStripedExampleSource = require('!!raw!../examples/ProgressStriped.jsx'); |
| 14 | +import ProgressMaxExample from '../examples/ProgressMax'; |
| 15 | +const ProgressMaxExampleSource = require('!!raw!../examples/ProgressMax.jsx'); |
| 16 | + |
| 17 | +export default class ProgressPage extends React.Component { |
| 18 | + render() { |
| 19 | + return ( |
| 20 | + <div> |
| 21 | + <Helmet title="Progress" /> |
| 22 | + <h3>Progress</h3> |
| 23 | + <div className="docs-example"> |
| 24 | + <ProgressExample /> |
| 25 | + </div> |
| 26 | + <pre> |
| 27 | + <PrismCode className="language-jsx"> |
| 28 | + {ProgressExampleSource} |
| 29 | + </PrismCode> |
| 30 | + </pre> |
| 31 | + <h4>Properties</h4> |
| 32 | + <pre> |
| 33 | + <PrismCode className="language-jsx"> |
| 34 | +{`Progress.propTypes = { |
| 35 | + tag: PropTypes.string, |
| 36 | + value: PropTypes.oneOfType([ |
| 37 | + PropTypes.string, |
| 38 | + PropTypes.number, |
| 39 | + ]), |
| 40 | + max: PropTypes.oneOf([ |
| 41 | + PropTypes.string, |
| 42 | + PropTypes.number, |
| 43 | + ]), |
| 44 | + animated: PropTypes.bool, |
| 45 | + stripped: PropTypes.bool, |
| 46 | + color: PropTypes.string, |
| 47 | + className: PropTypes.any |
| 48 | +}; |
| 49 | +
|
| 50 | +Progress.defaultProps = { |
| 51 | + tag: 'progress', |
| 52 | + value: 0, |
| 53 | + max: 100, |
| 54 | +};`} |
| 55 | + </PrismCode> |
| 56 | + </pre> |
| 57 | + |
| 58 | + <h3>Color Variants</h3> |
| 59 | + <div className="docs-example"> |
| 60 | + <div> |
| 61 | + <ProgressColorExample /> |
| 62 | + </div> |
| 63 | + </div> |
| 64 | + <pre> |
| 65 | + <PrismCode className="language-jsx"> |
| 66 | + {ProgressColorExampleSource} |
| 67 | + </PrismCode> |
| 68 | + </pre> |
| 69 | + |
| 70 | + <h3>Striped</h3> |
| 71 | + <div className="docs-example"> |
| 72 | + <div> |
| 73 | + <ProgressStripedExample /> |
| 74 | + </div> |
| 75 | + </div> |
| 76 | + <pre> |
| 77 | + <PrismCode className="language-jsx"> |
| 78 | + {ProgressStripedExampleSource} |
| 79 | + </PrismCode> |
| 80 | + </pre> |
| 81 | + |
| 82 | + <h3>Animated</h3> |
| 83 | + <p> |
| 84 | + The <code>animated</code> prop also adds the <code>striped</code> prop; there is no need to pass both. |
| 85 | + </p> |
| 86 | + <Card block outline color="danger"> |
| 87 | + <CardText> |
| 88 | + Currently, animated progress does not work in bootstrap v4 (alpha 3). This is an issue bootstrap has to |
| 89 | + resolve. |
| 90 | + </CardText> |
| 91 | + </Card> |
| 92 | + <div className="docs-example"> |
| 93 | + <div> |
| 94 | + <ProgressAnimatedExample /> |
| 95 | + </div> |
| 96 | + </div> |
| 97 | + <pre> |
| 98 | + <PrismCode className="language-jsx"> |
| 99 | + {ProgressAnimatedExampleSource} |
| 100 | + </PrismCode> |
| 101 | + </pre> |
| 102 | + |
| 103 | + <h3>Max value</h3> |
| 104 | + <div className="docs-example"> |
| 105 | + <div> |
| 106 | + <ProgressMaxExample /> |
| 107 | + </div> |
| 108 | + </div> |
| 109 | + <pre> |
| 110 | + <PrismCode className="language-jsx"> |
| 111 | + {ProgressMaxExampleSource} |
| 112 | + </PrismCode> |
| 113 | + </pre> |
| 114 | + |
| 115 | + </div> |
| 116 | + ); |
| 117 | + } |
| 118 | +} |
0 commit comments