-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement use phasing radio buttons
- Loading branch information
Showing
5 changed files
with
112 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import PropTypes from 'prop-types'; | ||
import { FormGroup, Input, Label } from 'reactstrap'; | ||
import config from '../services/config'; | ||
|
||
export default function UsePhasing({ phaseField, disabled, inline, dispatch }) { | ||
const handleChange = (event) => dispatch({ type: 'usePhasing', payload: event.target.value }); | ||
|
||
return ( | ||
<> | ||
<b className="me-3">Use Phasing:</b> | ||
<FormGroup check inline={inline}> | ||
<Input | ||
id="use-phasing-constrained" | ||
name={`phasing-${inline}`} | ||
type="radio" | ||
value={config.fieldNames.phase} | ||
checked={phaseField === config.fieldNames.phase} | ||
disabled={disabled} | ||
onChange={handleChange} | ||
/> | ||
<Label check for="use-phasing-constrained"> | ||
Financially Constrained | ||
</Label> | ||
</FormGroup> | ||
<FormGroup check inline> | ||
<Input | ||
id="use-phasing-needs" | ||
name={`phasing-${inline}`} | ||
type="radio" | ||
value={config.fieldNames.phaseNeeded} | ||
checked={phaseField === config.fieldNames.phaseNeeded} | ||
disabled={disabled} | ||
onChange={handleChange} | ||
/> | ||
<Label check for="use-phasing-needs"> | ||
Needs | ||
</Label> | ||
</FormGroup> | ||
</> | ||
); | ||
} | ||
|
||
UsePhasing.propTypes = { | ||
phaseField: PropTypes.string.isRequired, | ||
disabled: PropTypes.bool.isRequired, | ||
inline: PropTypes.bool, | ||
dispatch: PropTypes.func.isRequired, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters