Skip to content

Commit cc06af8

Browse files
committed
vscode and prettier based formatting
1 parent a582cdb commit cc06af8

File tree

4 files changed

+39
-23
lines changed

4 files changed

+39
-23
lines changed

src/components/App/App.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React from 'react';
2-
import Calculator from '../Calculator/Calculator';
3-
import './App.css';
1+
import React from "react";
2+
import Calculator from "../Calculator/Calculator";
3+
import "./App.css";
44

55
const App = () => (
66
<div className="app-container">

src/components/Display/Display.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React from 'react';
2-
import PropTypes from 'prop-types';
3-
import './Display.css';
1+
import React from "react";
2+
import PropTypes from "prop-types";
3+
import "./Display.css";
44

55
const Display = ({ displayValue }) => (
66
<div className="display-container">
@@ -10,6 +10,6 @@ const Display = ({ displayValue }) => (
1010

1111
Display.propTypes = { displayValue: PropTypes.string.isRequired };
1212

13-
Display.defaultProps = { displayValue: 'default' };
13+
Display.defaultProps = { displayValue: "default" };
1414

1515
export default Display;

src/components/Key/Key.jsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
import React from 'react';
2-
import PropTypes from 'prop-types';
3-
import './Key.css';
1+
import React from "react";
2+
import PropTypes from "prop-types";
3+
import "./Key.css";
44

55
const Key = ({ handleKeyPress, keyAction, keyType, keyValue }) => {
66
const keyClass = `key-container ${keyType}`;
77

88
return (
9-
<div className={keyClass} onClick={() => keyAction(keyValue)} onKeyPress={event => handleKeyPress(event)}>
9+
<div
10+
className={keyClass}
11+
onClick={() => keyAction(keyValue)}
12+
onKeyPress={event => handleKeyPress(event)}
13+
>
1014
<p className="key-value">{keyValue}</p>
1115
</div>
1216
);
@@ -16,12 +20,12 @@ Key.propTypes = {
1620
handleKeyPress: PropTypes.func.isRequired,
1721
keyAction: PropTypes.func.isRequired,
1822
keyType: PropTypes.string.isRequired,
19-
keyValue: PropTypes.string.isRequired,
23+
keyValue: PropTypes.string.isRequired
2024
};
2125

2226
Key.defaultProps = {
23-
keyType: 'default',
24-
keyAction: 'default',
27+
keyType: "default",
28+
keyAction: "default"
2529
};
2630

2731
export default Key;

src/components/Keypad/Keypad.jsx

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1-
import React from 'react';
2-
import PropTypes from 'prop-types';
3-
import './Keypad.css';
1+
import React from "react";
2+
import PropTypes from "prop-types";
3+
import "./Keypad.css";
44

5-
import Key from '../Key/Key';
6-
import './Keypad.css';
5+
import Key from "../Key/Key";
6+
import "./Keypad.css";
77

8-
const Keypad = ({ operators, callOperator, handleKeyPress, numbers, setOperator, updateDisplay }) => {
8+
const Keypad = ({
9+
operators,
10+
callOperator,
11+
handleKeyPress,
12+
numbers,
13+
setOperator,
14+
updateDisplay
15+
}) => {
916
const numberKeys = numbers.map((number, iterator) => (
1017
<Key
1118
handleKeyPress={handleKeyPress}
@@ -31,7 +38,12 @@ const Keypad = ({ operators, callOperator, handleKeyPress, numbers, setOperator,
3138
<div className="numbers-container">{numberKeys}</div>
3239
<div className="operators-container">{operatorKeys}</div>
3340
<div className="submit-container">
34-
<Key handleKeyPress={handleKeyPress} keyType="submit-key" keyValue="=" keyAction={callOperator} />
41+
<Key
42+
handleKeyPress={handleKeyPress}
43+
keyType="submit-key"
44+
keyValue="="
45+
keyAction={callOperator}
46+
/>
3547
</div>
3648
</div>
3749
);
@@ -43,12 +55,12 @@ Keypad.propTypes = {
4355
numbers: PropTypes.array.isRequired,
4456
operators: PropTypes.array.isRequired,
4557
setOperator: PropTypes.func.isRequired,
46-
updateDisplay: PropTypes.func.isRequired,
58+
updateDisplay: PropTypes.func.isRequired
4759
};
4860

4961
Keypad.defaultProps = {
5062
numbers: [],
51-
operators: [],
63+
operators: []
5264
};
5365

5466
export default Keypad;

0 commit comments

Comments
 (0)