Completely updated React, fixed #11, (hopefully)
This commit is contained in:
54
goTorrentWebUI/node_modules/material-ui/Stepper/StepIcon.js.flow
generated
vendored
Normal file
54
goTorrentWebUI/node_modules/material-ui/Stepper/StepIcon.js.flow
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import CheckCircle from '../internal/svg-icons/CheckCircle';
|
||||
import withStyles from '../styles/withStyles';
|
||||
import StepPositionIcon from './StepPositionIcon';
|
||||
|
||||
export const styles = theme => ({
|
||||
root: {
|
||||
display: 'block',
|
||||
},
|
||||
completed: {
|
||||
color: theme.palette.primary.main,
|
||||
},
|
||||
});
|
||||
|
||||
function StepIcon(props) {
|
||||
const { completed, icon, active, classes } = props;
|
||||
|
||||
if (typeof icon === 'number' || typeof icon === 'string') {
|
||||
if (completed) {
|
||||
return <CheckCircle className={classNames(classes.root, classes.completed)} />;
|
||||
}
|
||||
return <StepPositionIcon className={classes.root} position={icon} active={active} />;
|
||||
}
|
||||
|
||||
return icon;
|
||||
}
|
||||
|
||||
StepIcon.propTypes = {
|
||||
/**
|
||||
* Whether this step is active.
|
||||
*/
|
||||
active: PropTypes.bool,
|
||||
/**
|
||||
* Classses for component style customizations.
|
||||
*/
|
||||
classes: PropTypes.object.isRequired,
|
||||
/**
|
||||
* Mark the step as completed. Is passed to child components.
|
||||
*/
|
||||
completed: PropTypes.bool,
|
||||
/**
|
||||
* The icon displayed by the step label.
|
||||
*/
|
||||
icon: PropTypes.node.isRequired,
|
||||
};
|
||||
|
||||
StepIcon.defaultProps = {
|
||||
active: false,
|
||||
completed: false,
|
||||
};
|
||||
|
||||
export default withStyles(styles, { name: 'MuiStepIcon' })(StepIcon);
|
Reference in New Issue
Block a user