figbertmath

[RADIOACTIVE] miscellaneous math programs in website form
git clone git://git.figbert.com/figbertmath.git
Log | Files | Refs | README

commit 19acf52bb3892c86e0e3b53937ec1c853bdf3553
parent 10b5deadd432cea70911acab2f33670ead661d13
Author: therealFIGBERT <figbertwelner@gmail.com>
Date:   Thu,  5 Dec 2019 20:06:45 -0800

Organize functions and props in the lowLevel js files

Lines sorted with atom's sort-lines.

Diffstat:
Msrc/components/lowLevel/largeButton/index.js | 25++++++++++++-------------
Msrc/components/lowLevel/pad/index.js | 21++++++++++-----------
Msrc/components/lowLevel/smallButton/index.js | 3+--
3 files changed, 23 insertions(+), 26 deletions(-)

diff --git a/src/components/lowLevel/largeButton/index.js b/src/components/lowLevel/largeButton/index.js @@ -4,9 +4,9 @@ import styles from './styles.module.css'; export class LargeButton extends React.Component { render() { - const canBeDisabled = this.props.mode === 'angSize', - acceptsInput = this.props.mode !== 'select', - equationFormat = this.props.mode === 'simultaneousEQ'; + const acceptsInput = this.props.mode !== 'select', + equationFormat = this.props.mode === 'simultaneousEQ', + canBeDisabled = this.props.mode === 'angSize'; if (this.props.value === 'select') { return ( <button @@ -157,18 +157,18 @@ export class LargeButton extends React.Component { } LargeButton.propTypes = { + disabledTruth: PropTypes.bool, + displayValue: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.number + ]), mode: PropTypes.string.isRequired, - onClick: PropTypes.func, onChange: PropTypes.func, + onClick: PropTypes.func, onModeClick: PropTypes.func, - disabledTruth: PropTypes.bool, + textValue: PropTypes.string, value: PropTypes.oneOfType([ PropTypes.string, PropTypes.array - ]), - displayValue: PropTypes.oneOfType([ - PropTypes.string, - PropTypes.number - ]), - textValue: PropTypes.string -}; -\ No newline at end of file + ]) +}; diff --git a/src/components/lowLevel/pad/index.js b/src/components/lowLevel/pad/index.js @@ -6,13 +6,13 @@ import styles from './styles.module.css'; export class Pad extends React.Component { render() { - const mode = this.props.mode, - onClick = this.props.onClick, + const disabledTruths = this.props.disabledTruths, + displayValues = this.props.displayValues, onChange = this.props.onChange, + onClick = this.props.onClick, onModeClick = this.props.onModeClick, - disabledTruths = this.props.disabledTruths, - displayValues = this.props.displayValues, - textValues = this.props.textValues; + textValues = this.props.textValues, + mode = this.props.mode; let rows; if (this.props.type === 'small') { rows = this.props.buttonValues.map(function (array, index, _) { @@ -27,14 +27,14 @@ export class Pad extends React.Component { rows = this.props.buttonValues.map(function (value, index, _) { return ( <LargeButton + disabledTruth={disabledTruths == null ? false : disabledTruths[index]} + displayValue={displayValues == null ? '' : displayValues[index]} mode={mode} - onClick={onClick} onChange={onChange} + onClick={onClick} onModeClick={onModeClick} - value={value} - disabledTruth={disabledTruths == null ? false : disabledTruths[index]} - displayValue={displayValues == null ? '' : displayValues[index]} textValue={textValues == null ? '' : textValues[index]} + value={value} /> ); }); @@ -56,4 +56,4 @@ Pad.propTypes = { disabledTruths: PropTypes.arrayOf(PropTypes.bool), displayValues: PropTypes.array, textValues: PropTypes.arrayOf(PropTypes.string) -}; -\ No newline at end of file +}; diff --git a/src/components/lowLevel/smallButton/index.js b/src/components/lowLevel/smallButton/index.js @@ -46,4 +46,4 @@ SmallButtonRow.propTypes = { buttonValues: PropTypes.arrayOf(PropTypes.string).isRequired, onClick: PropTypes.func, onModeClick: PropTypes.func -}; -\ No newline at end of file +};