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

Commit

Permalink
Resolves #19: Fixed regression in displayed values that caused all va…
Browse files Browse the repository at this point in the history
…lues to be displayed as strings. Also fixed secondary regression that caused null or undefined values to be displayed as empty strings
  • Loading branch information
bvaughn committed Jan 12, 2016
1 parent 0dccc37 commit fb671f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/JSONValueNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export default class JSONValueNode extends React.Component {
</label>
<span style={{
color: this.props.theme.base0B,
...this.props.styles.getValueStyle('String', true)
}}>"{this.props.valueRenderer(this.props.valueGetter(this.props.value))}"</span>
...this.props.styles.getValueStyle(this.props.nodeType, true)
}}>{this.props.valueRenderer(this.props.valueGetter(this.props.value))}</span>
</li>
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/grab-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@ export default function({
case 'Iterable':
return <JSONIterableNode {...nestedNodeProps} />;
case 'String':
return <JSONValueNode {...simpleNodeProps} />;
return <JSONValueNode {...simpleNodeProps} valueGetter={raw => `"${raw}"`} />;
case 'Number':
return <JSONValueNode {...simpleNodeProps} />;
case 'Boolean':
return <JSONValueNode {...simpleNodeProps} valueGetter={raw => raw ? 'true' : 'false'} />;
case 'Date':
return <JSONValueNode {...simpleNodeProps} valueGetter={raw => raw.toISOString()} />;
case 'Null':
return <JSONValueNode {...simpleNodeProps} valueGetter={() => null} />;
return <JSONValueNode {...simpleNodeProps} valueGetter={() => 'null'} />;
case 'Undefined':
return <JSONValueNode {...simpleNodeProps} valueGetter={() => undefined} />;
return <JSONValueNode {...simpleNodeProps} valueGetter={() => 'undefined'} />;
case 'Function':
return <JSONValueNode {...simpleNodeProps} valueGetter={raw => raw.toString()} />;
default:
Expand Down

0 comments on commit fb671f1

Please sign in to comment.