Skip to content

Commit

Permalink
Tweak attribute whitelist table (#10559)
Browse files Browse the repository at this point in the history
* Move null and undefined to the end

* Highlight attributes with changes
  • Loading branch information
gaearon authored Aug 28, 2017
1 parent 575cfad commit ebb5a33
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions fixtures/attribute-behavior/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@ const types = [
testValue: 'a string',
testDisplayValue: "'a string'",
},
{
name: 'null',
testValue: null,
},
{
name: 'undefined',
testValue: undefined,
},
{
name: 'empty string',
testValue: '',
Expand Down Expand Up @@ -115,6 +107,14 @@ const types = [
name: 'function',
testValue: function f() {},
},
{
name: 'null',
testValue: null,
},
{
name: 'undefined',
testValue: undefined,
},
];

function getProperty(propertyName) {
Expand Down Expand Up @@ -2841,7 +2841,14 @@ function CellContent(props) {
if (rowIndex === 0) {
return null;
}
return <RowHeader>{attribute.name}</RowHeader>;
const hasSameBehaviorForAll = types.every(
type => table.get(attribute).get(type.name).hasSameBehavior
);
return (
<RowHeader>
{hasSameBehaviorForAll ? attribute.name : <b>{attribute.name}</b>}
</RowHeader>
);
}

if (rowIndex === 0) {
Expand Down

0 comments on commit ebb5a33

Please sign in to comment.