Skip to content
This repository has been archived by the owner on May 20, 2019. It is now read-only.

Added 'circleLineHeight' prop #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ See full example [here](https://github.com/mu29/react-stepper/blob/master/exampl
|circleFontColor|Circle text color (for index)|#FFF|string|
|size|Circle size|32|number|
|circleFontSize|Circle text size|16|number|
|circleLineHeight|Circle line height||number|
|titleFontSize|Title text size|16|number|
|circleTop|Top margin of `Stepper` component|24|number|
|titleTop|Space between circle and title|8|number|
Expand Down
6 changes: 4 additions & 2 deletions lib/Step.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ var Step = function (_Component) {
completeBorderStyle = _props.completeBorderStyle,
activeBorderStyle = _props.activeBorderStyle,
lineMarginOffset = _props.lineMarginOffset,
defaultBorderWidth = _props.defaultBorderWidth;
defaultBorderWidth = _props.defaultBorderWidth,
circleLineHeight = _props.circleLineHeight;


return {
Expand Down Expand Up @@ -106,7 +107,7 @@ var Step = function (_Component) {
borderStyle: completeBorderStyle
},
index: {
lineHeight: size + circleFontSize / 4 + 'px',
lineHeight: (circleLineHeight || size + circleFontSize) + 'px',
color: circleFontColor
},
title: {
Expand Down Expand Up @@ -249,6 +250,7 @@ Step.propTypes = {
circleFontColor: _propTypes.PropTypes.string,
size: _propTypes.PropTypes.number,
circleFontSize: _propTypes.PropTypes.number,
circleLineHeight: _propTypes.PropTypes.number,
titleFontSize: _propTypes.PropTypes.number,
circleTop: _propTypes.PropTypes.number,
titleTop: _propTypes.PropTypes.number,
Expand Down
5 changes: 4 additions & 1 deletion lib/Stepper.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ function Stepper(_ref) {
defaultBarColor = _ref.defaultBarColor,
completeBarColor = _ref.completeBarColor,
lineMarginOffset = _ref.lineMarginOffset,
defaultBorderWidth = _ref.defaultBorderWidth;
defaultBorderWidth = _ref.defaultBorderWidth,
circleLineHeight = _ref.circleLineHeight;

return _react2.default.createElement(
'div',
Expand Down Expand Up @@ -91,6 +92,7 @@ function Stepper(_ref) {
defaultTitleColor: defaultTitleColor,
size: size,
circleFontSize: circleFontSize,
circleLineHeight: circleLineHeight,
titleFontSize: titleFontSize,
circleTop: circleTop,
titleTop: titleTop,
Expand Down Expand Up @@ -133,6 +135,7 @@ Stepper.propTypes = {
circleFontColor: _propTypes.PropTypes.string,
size: _propTypes.PropTypes.number,
circleFontSize: _propTypes.PropTypes.number,
circleLineHeight: _propTypes.PropTypes.number,
titleFontSize: _propTypes.PropTypes.number,
circleTop: _propTypes.PropTypes.number,
titleTop: _propTypes.PropTypes.number,
Expand Down
6 changes: 4 additions & 2 deletions src/Step.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export default class Step extends Component {
circleTop, titleTop, width, completeOpacity, activeOpacity, defaultOpacity,
completeTitleOpacity, activeTitleOpacity, defaultTitleOpacity, barStyle, defaultBarColor,
completeBarColor, defaultBorderColor, completeBorderColor, activeBorderColor,
defaultBorderStyle,completeBorderStyle, activeBorderStyle, lineMarginOffset, defaultBorderWidth
defaultBorderStyle,completeBorderStyle, activeBorderStyle, lineMarginOffset, defaultBorderWidth,
circleLineHeight
} = this.props;

return {
Expand Down Expand Up @@ -56,7 +57,7 @@ export default class Step extends Component {
borderStyle: completeBorderStyle,
},
index: {
lineHeight: `${size + circleFontSize / 4}px`,
lineHeight: `${circleLineHeight || (size + circleFontSize)}px`,
color: circleFontColor
},
title: {
Expand Down Expand Up @@ -180,6 +181,7 @@ Step.propTypes = {
circleFontColor: PropTypes.string,
size: PropTypes.number,
circleFontSize: PropTypes.number,
circleLineHeight: PropTypes.number,
titleFontSize: PropTypes.number,
circleTop: PropTypes.number,
titleTop: PropTypes.number,
Expand Down
5 changes: 4 additions & 1 deletion src/Stepper.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ function Stepper({
circleTop, titleTop, completeOpacity, activeOpacity, defaultOpacity,
completeTitleOpacity, activeTitleOpacity, defaultTitleOpacity, barStyle,
defaultBorderColor, completeBorderColor, activeBorderColor, defaultBorderStyle,
completeBorderStyle, activeBorderStyle, defaultBarColor, completeBarColor, lineMarginOffset, defaultBorderWidth
completeBorderStyle, activeBorderStyle, defaultBarColor, completeBarColor, lineMarginOffset, defaultBorderWidth,
circleLineHeight
}) {
return (
<div style={ styles.root }>
Expand All @@ -51,6 +52,7 @@ function Stepper({
defaultTitleColor={defaultTitleColor}
size={size}
circleFontSize={circleFontSize}
circleLineHeight={circleLineHeight}
titleFontSize={titleFontSize}
circleTop={circleTop}
titleTop={titleTop}
Expand Down Expand Up @@ -94,6 +96,7 @@ Stepper.propTypes = {
circleFontColor: PropTypes.string,
size: PropTypes.number,
circleFontSize: PropTypes.number,
circleLineHeight: PropTypes.number,
titleFontSize: PropTypes.number,
circleTop: PropTypes.number,
titleTop: PropTypes.number,
Expand Down