@@ -3,18 +3,28 @@ import PropTypes from 'prop-types';
33import { omit } from 'ramda' ;
44import { Progress as RSProgress } from 'reactstrap' ;
55
6+ const CustomProgressTag = props => {
7+ // This is a little trick to enable us to pass styles to the outer div
8+ const { outer_style, style, ...otherProps } = props ;
9+ return < div style = { outer_style } { ...otherProps } /> ;
10+ } ;
11+
612/**
713 * A component for creating progress bars just with CSS. Control the current
814 * progress with a callback and the `value` prop.
915 */
1016const Progress = props => {
11- const { children, loading_state, ...otherProps } = props ;
17+ const { children, loading_state, bar_style , style , ...otherProps } = props ;
1218 return (
1319 < RSProgress
1420 { ...omit ( [ 'setProps' ] , otherProps ) }
1521 data-dash-is-loading = {
1622 ( loading_state && loading_state . is_loading ) || undefined
1723 }
24+ // reactstrap handles these inconsistently atm, have to swap around
25+ style = { bar_style }
26+ outer_style = { style }
27+ tag = { CustomProgressTag }
1828 >
1929 { children }
2030 </ RSProgress >
@@ -97,6 +107,11 @@ Progress.propTypes = {
97107 */
98108 barClassName : PropTypes . string ,
99109
110+ /**
111+ * Style arguments to pass to the bar.
112+ */
113+ bar_style : PropTypes . object ,
114+
100115 /**
101116 * Object that holds the loading state object coming from dash-renderer
102117 */
0 commit comments