Skip to content

Commit 6833d2d

Browse files
committed
move more styles to sass from inline
1 parent e266339 commit 6833d2d

File tree

4 files changed

+31
-40
lines changed

4 files changed

+31
-40
lines changed

src/assets/style/sidebar.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@
4545
width: 100%;
4646
}
4747

48+
.composerContents_content {
49+
display: flex;
50+
flex-direction: column;
51+
outline: none;
52+
}
53+
54+
55+
4856
.composer_submit,
4957
.addMetadata {
5058
-webkit-appearance: none;
@@ -426,6 +434,7 @@
426434
padding: 5px;
427435
width: 100%;
428436
font-size: 14px;
437+
resize: none;
429438

430439
&:focus {
431440
outline: 0 none;

src/client/components/composer/ComposerContainer.jsx

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,6 @@ const mapDispatchToProps = (dispatch) => ({
5151
class ComposerContainer extends Component {
5252
constructor(props) {
5353
super(props);
54-
// this.state = {};
55-
}
56-
57-
componentDidMount() {
58-
// this.setState({
59-
// composerDisplay: this.props.composerDisplay,
60-
// });
61-
}
62-
63-
componentDidUpdate() {
64-
//keeping the redux store state in sync with this component's local state
65-
// if (this.props.composerDisplay !== this.state.composerDisplay) {
66-
// this.setState({
67-
// composerDisplay: this.props.composerDisplay,
68-
// });
69-
// }
7054
}
7155

7256
render() {

src/client/components/composer/NewRequest/BodyEntryForm.jsx

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ class BodyEntryForm extends Component {
1818
}
1919

2020
render() {
21-
let rawTypeStyles = {
21+
const rawTypeStyles = {
2222
display: this.props.newRequestBody.bodyType === "raw" ? "block" : "none",
2323
};
2424

25-
let bodyEntryArea = (() => {
25+
const bodyEntryArea = (() => {
2626
//BodyType of none : display nothing
2727
if (this.props.newRequestBody.bodyType === "none") {
2828
return;
2929
}
3030
//BodyType of XWWW... : display WWWForm entry
31-
else if (this.props.newRequestBody.bodyType === "x-www-form-urlencoded") {
31+
if (this.props.newRequestBody.bodyType === "x-www-form-urlencoded") {
3232
return (
3333
<WWWForm
3434
setNewRequestBody={this.props.setNewRequestBody}
@@ -37,7 +37,7 @@ class BodyEntryForm extends Component {
3737
);
3838
}
3939
//RawType of application/json : Text area box with error checking
40-
else if (this.props.newRequestBody.rawType === "application/json") {
40+
if (this.props.newRequestBody.rawType === "application/json") {
4141
return (
4242
<JSONTextArea
4343
setNewRequestBody={this.props.setNewRequestBody}
@@ -46,24 +46,22 @@ class BodyEntryForm extends Component {
4646
);
4747
}
4848
//all other cases..just plain text area
49-
else {
50-
return (
51-
<textarea
52-
value={this.props.newRequestBody.bodyContent}
53-
className={"composer_textarea"}
54-
style={{ resize: "none" }}
55-
type="text"
56-
placeholder="Body"
57-
rows={10}
58-
onChange={(e) => {
59-
this.props.setNewRequestBody({
60-
...this.props.newRequestBody,
61-
bodyContent: e.target.value,
62-
});
63-
}}
64-
></textarea>
65-
);
66-
}
49+
50+
return (
51+
<textarea
52+
value={this.props.newRequestBody.bodyContent}
53+
className="composer_textarea"
54+
type="text"
55+
placeholder="Body"
56+
rows={10}
57+
onChange={(e) => {
58+
this.props.setNewRequestBody({
59+
...this.props.newRequestBody,
60+
bodyContent: e.target.value,
61+
});
62+
}}
63+
/>
64+
);
6765
})();
6866

6967
const arrowClass = this.state.show
@@ -80,7 +78,7 @@ class BodyEntryForm extends Component {
8078
onClick={this.toggleShow}
8179
style={this.props.stylesObj}
8280
>
83-
<img className={arrowClass} src={dropDownArrow}></img>
81+
<img className={arrowClass} src={dropDownArrow} alt="down arrow" />
8482
Body
8583
</div>
8684

src/client/components/composer/NewRequest/ComposerNewRequest.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,9 @@ class ComposerNewRequest extends Component {
378378
}
379379
return (
380380
<div
381+
className="composerContents_content"
381382
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
382383
tabIndex={0}
383-
style={{ display: "flex", flexDirection: "column", outline: "none" }}
384384
>
385385
<h1 className="composer_title">Create New Request</h1>
386386

0 commit comments

Comments
 (0)