mirror of
https://github.com/TrentSPalmer/fcc-challenges.git
synced 2025-07-04 18:13:15 -07:00
add calculator-react
This commit is contained in:
34
calculator-react/src/Plus.js
Normal file
34
calculator-react/src/Plus.js
Normal file
@ -0,0 +1,34 @@
|
||||
import React from 'react';
|
||||
import { connect } from "react-redux";
|
||||
|
||||
const mapStateToProps = (state) => ({ ...state });
|
||||
|
||||
class Minus extends React.Component {
|
||||
render() {
|
||||
const width = this.props.innerWindowWidth;
|
||||
const height = this.props.innerWindowHeight;
|
||||
const style = {
|
||||
gridColumnStart: 5,
|
||||
gridColumnEnd: 6,
|
||||
gridRowStart: 3,
|
||||
gridRowEnd: 4,
|
||||
borderBottom: '3px solid black',
|
||||
borderRight: '3px solid black',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
justifyContent: 'center',
|
||||
};
|
||||
|
||||
if (height > width) {
|
||||
style['gridColumnStart'] = 4;
|
||||
style['gridColumnEnd'] = 5;
|
||||
style['borderRight'] = 'unset';
|
||||
}
|
||||
|
||||
return (
|
||||
<div id="minus" style={style}>-</div>
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps)(Minus);
|
Reference in New Issue
Block a user