Skip to content

Commit

Permalink
Meging the third milestone to the develop branch
Browse files Browse the repository at this point in the history
Third milestone merged to the develop branch
  • Loading branch information
moudio committed Mar 5, 2020
2 parents 5ad1696 + 7a8b61f commit 8e2ed01
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 65 deletions.
40 changes: 4 additions & 36 deletions src/App.css
@@ -1,38 +1,6 @@
.App {
text-align: center;
}

.App-logo {
height: 40vmin;
pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}

.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

.App-link {
color: #61dafb;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
display: flex;
flex-direction: column;
width: 700px;
margin: 50px auto;
}
9 changes: 9 additions & 0 deletions src/Button.css
@@ -0,0 +1,9 @@
.Button {
width: 25%;
text-align: center;
font-size: 20px;
font-weight: bold;
color: black;
height: 100%

}
3 changes: 3 additions & 0 deletions src/ButtonPanel.css
@@ -0,0 +1,3 @@
.ButtonPanel .group {
height: 100px;
}
9 changes: 9 additions & 0 deletions src/Display.css
@@ -0,0 +1,9 @@
.Display {
background: grey;
height: 100px;
color: white;
font-weight: bold;
font-size: 80px;
padding: 10px;
text-align: right;
}
2 changes: 1 addition & 1 deletion src/components/App.js
Expand Up @@ -11,7 +11,7 @@ class App extends React.Component {

render() {
return (
<div>
<div className="App">
<Display result="0" />
<ButtonPanel />
</div>
Expand Down
15 changes: 9 additions & 6 deletions src/components/Button.js
@@ -1,19 +1,22 @@
import React from 'react';
import Proptypes from 'prop-types';
import '../Button.css';

const button = props => {
const { name } = props;
return (
<button type="button">{name}</button>
);
};
const button = ({ name, color, wide }) => (
<button type="button" className="Button" style={{ background: color, width: wide === true ? '50%' : '25%' }}>{name}</button>
);

button.defaultProps = {
name: '',
color: '#FA9F42',
wide: false,
};

button.propTypes = {
name: Proptypes.string,
color: Proptypes.string,
wide: Proptypes.bool,
};


export default button;
43 changes: 22 additions & 21 deletions src/components/ButtonPanel.js
@@ -1,35 +1,36 @@
import React from 'react';
import Button from './Button';
import '../ButtonPanel.css';

const buttonPanel = () => (
<div>
<div className="group-1">
<Button name="AC" />
<Button name="+/-" />
<Button name="%" />
<Button name="+" />
<div className="ButtonPanel">
<div className="group group-1">
<Button name="AC" color="#E0E0E2" />
<Button name="+/-" color="#E0E0E2" />
<Button name="%" color="#E0E0E2" />
<Button name="÷" />
</div>
<div className="group-2">
<Button name="7" />
<Button name="8" />
<Button name="9" />
<div className="group group-2">
<Button name="7" color="#E0E0E2" />
<Button name="8" color="#E0E0E2" />
<Button name="9" color="#E0E0E2" />
<Button name="X" />
</div>
<div className="group-3">
<Button name="4" />
<Button name="5" />
<Button name="6" />
<div className="group group-3">
<Button name="4" color="#E0E0E2" />
<Button name="5" color="#E0E0E2" />
<Button name="6" color="#E0E0E2" />
<Button name="-" />
</div>
<div className="group-4">
<Button name="1" />
<Button name="2" />
<Button name="3" />
<div className="group group-4">
<Button name="1" color="#E0E0E2" />
<Button name="2" color="#E0E0E2" />
<Button name="3" color="#E0E0E2" />
<Button name="+" />
</div>
<div className="group-5">
<Button name="0" />
<Button name="." />
<div className="group group-5">
<Button name="0" wide color="#E0E0E2" />
<Button name="." color="#E0E0E2" />
<Button name="=" />
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/components/Display.js
@@ -1,10 +1,11 @@
import React from 'react';
import Proptypes from 'prop-types';
import '../Display.css';

const display = props => {
const { result } = props;
return (
<div>
<div className="Display">
{result}
</div>
);
Expand Down

0 comments on commit 8e2ed01

Please sign in to comment.