Skip to content

Commit

Permalink
Rename showChildrenStatus attribute from SpanTreeOffset to showChildr…
Browse files Browse the repository at this point in the history
…enIcon

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>
  • Loading branch information
rubenvp8510 committed Feb 22, 2019
1 parent 717984b commit 5ec5ac2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default class SpanDetailRow extends React.PureComponent<SpanDetailRowProp
return (
<TimelineRow className="detail-row">
<TimelineRow.Cell width={columnDivision}>
<SpanTreeOffset span={span} showChildrenStatus={false} />
<SpanTreeOffset span={span} showChildrenIcon={false} />
<span>
<span
className="detail-row-expanded-accent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('<SpanDetailRow>', () => {
});

it('renders the span tree offset', () => {
const spanTreeOffset = <SpanTreeOffset span={props.span} showChildrenStatus={false} />;
const spanTreeOffset = <SpanTreeOffset span={props.span} showChildrenIcon={false} />;
expect(wrapper.contains(spanTreeOffset)).toBe(true);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type SpanTreeOffsetPropsType = {
onClick: ?() => void,
removeHoverIndentGuideId: string => void,
span: Span,
showChildrenStatus: boolean,
showChildrenIcon: boolean,
};

export class UnconnectedSpanTreeOffset extends React.PureComponent<SpanTreeOffsetPropsType> {
Expand All @@ -47,7 +47,7 @@ export class UnconnectedSpanTreeOffset extends React.PureComponent<SpanTreeOffse
static defaultProps = {
childrenVisible: false,
onClick: null,
showChildrenStatus: true,
showChildrenIcon: true,
};

constructor(props: SpanTreeOffsetPropsType) {
Expand Down Expand Up @@ -107,11 +107,11 @@ export class UnconnectedSpanTreeOffset extends React.PureComponent<SpanTreeOffse
};

render() {
const { showChildrenStatus, childrenVisible, onClick, span } = this.props;
const { showChildrenIcon, childrenVisible, onClick, span } = this.props;
const { hasChildren, spanID } = span;
const wrapperProps = hasChildren ? { onClick, role: 'switch', 'aria-checked': childrenVisible } : null;
const icon =
showChildrenStatus && hasChildren && (childrenVisible ? <IoIosArrowDown /> : <IoChevronRight />);
showChildrenIcon && hasChildren && (childrenVisible ? <IoIosArrowDown /> : <IoChevronRight />);
return (
<span className={`SpanTreeOffset ${hasChildren ? 'is-parent' : ''}`} {...wrapperProps}>
{this.ancestorIds.map(ancestorId => (
Expand Down

0 comments on commit 5ec5ac2

Please sign in to comment.