mirror of
https://github.com/Kong/insomnia.git
synced 2026-10-27 09:09:14 -04:00
Change raw view to textarea for better performance
This commit is contained in:
1 parent
46d56804e6
commit
dabf153e92
4 files changed
+27
-18
No files matched your search
@@ -34,8 +34,7 @@ class RequestUrlBar extends Component {
|
||||
const hasError = !url;
|
||||
|
||||
return (
|
||||
<form className={classnames({'urlbar': true, 'urlbar--error': hasError})}
|
||||
onSubmit={this._handleFormSubmit.bind(this)}>
|
||||
<div className={classnames({'urlbar': true, 'urlbar--error': hasError})}>
|
||||
<Dropdown>
|
||||
<button type="button">
|
||||
<div className="tall">
|
||||
@@ -56,16 +55,19 @@ class RequestUrlBar extends Component {
|
||||
))}
|
||||
</ul>
|
||||
</Dropdown>
|
||||
<div className="form-control">
|
||||
<input
|
||||
ref={n => this.input = n}
|
||||
type="text"
|
||||
placeholder="https://api.myproduct.com/v1/users"
|
||||
defaultValue={url}
|
||||
onChange={e => this._handleUrlChange(e.target.value)}/>
|
||||
</div>
|
||||
<button type="submit" className="urlbar__send-button">Send</button>
|
||||
</form>
|
||||
<form onSubmit={this._handleFormSubmit.bind(this)}>
|
||||
<div className="form-control">
|
||||
<input
|
||||
ref={n => this.input = n}
|
||||
type="text"
|
||||
placeholder="https://api.myproduct.com/v1/users"
|
||||
defaultValue={url}
|
||||
onClick={e => e.preventDefault()}
|
||||
onChange={e => this._handleUrlChange(e.target.value)}/>
|
||||
</div>
|
||||
<button type="submit">Send</button>
|
||||
</form>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,6 +62,7 @@ class Dropdown extends Component {
|
||||
return (
|
||||
<div className={classes}
|
||||
onClick={this._handleClick.bind(this)}
|
||||
onMouseDown={e => e.preventDefault()}
|
||||
ref={n => this._node = n}>
|
||||
{this.props.children}
|
||||
<div className="dropdown__backdrop"></div>
|
||||
|
||||
@@ -62,10 +62,10 @@ class ResponseViewer extends Component {
|
||||
);
|
||||
default: // Raw
|
||||
return (
|
||||
<pre className="scrollable wide tall selectable monospace pad"
|
||||
style={{fontSize: editorFontSize}}>
|
||||
{body}
|
||||
</pre>
|
||||
<textarea className="scrollable wide tall selectable monospace pad no-resize"
|
||||
defaultValue={body}
|
||||
style={{fontSize: editorFontSize}}>
|
||||
</textarea>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.urlbar__send-button {
|
||||
form button {
|
||||
padding-right: @padding-md;
|
||||
padding-left: @padding-md;
|
||||
}
|
||||
@@ -65,7 +65,13 @@
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.urlbar__send-button,
|
||||
form {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
form button,
|
||||
& > .dropdown {
|
||||
height: 100%;
|
||||
|
||||
|
||||
Reference in new issue
Block a user