Skip to content
Open
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
76 changes: 48 additions & 28 deletions src/Explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -737,34 +737,54 @@ class AbstractArgView extends React.PureComponent<AbstractArgViewProps, {}> {
</span>
);
} else if (isScalarType(argType)) {
if (argType.name === 'Boolean') {
input = (
<select
style={{
color: styleConfig.colors.builtin,
}}
onChange={this.props.setArgValue}
value={
argValue.kind === 'BooleanValue' ? argValue.value : undefined
}>
<option key="true" value="true">
true
</option>
<option key="false" value="false">
false
</option>
</select>
);
} else {
input = (
<ScalarInput
setArgValue={this.props.setArgValue}
arg={arg}
argValue={argValue}
onRunOperation={this.props.onRunOperation}
styleConfig={this.props.styleConfig}
/>
);
switch (argType.name) {
case 'Boolean':
input = (
<select
style={{
color: styleConfig.colors.builtin,
}}
onChange={this.props.setArgValue}
value={
argValue.kind === 'BooleanValue' ? argValue.value : undefined
}>
<option key="true" value="true">
true
</option>
<option key="false" value="false">
false
</option>
</select>
);
break;
case 'HexColorCode':
input = (
<input
type="color"
value={argValue.value}
onChange={this.props.setArgValue}
/>
);
break;
case 'Date':
input = (
<input
type="date"
value={argValue.value}
onChange={this.props.setArgValue}
/>
);
break;
default:
input = (
<ScalarInput
setArgValue={this.props.setArgValue}
arg={arg}
argValue={argValue}
onRunOperation={this.props.onRunOperation}
styleConfig={this.props.styleConfig}
/>
);
}
} else if (isEnumType(argType)) {
if (argValue.kind === 'EnumValue') {
Expand Down