generated from hackforla/.github-hackforla-base-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
204 changed files
with
5,794 additions
and
1,373 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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,52 @@ | ||
import React, { useState } from "react"; | ||
import PropTypes from "prop-types"; | ||
import RuleView from "./RuleView"; | ||
import UniversalSelect from "../UI/UniversalSelect"; | ||
import { createUseStyles } from "react-jss"; | ||
|
||
const useStyles = createUseStyles({ | ||
select: { | ||
width: "275px" | ||
} | ||
}); | ||
|
||
const RuleViewContainer = props => { | ||
const { rules } = props; | ||
const [ruleId, setRuleId] = useState(rules[0].id); | ||
const rule = rules.filter(rule => rule.id === ruleId)[0]; | ||
const classes = useStyles(); | ||
|
||
const handleSetRule = e => { | ||
const ruleId = Number(e.target.value); | ||
setRuleId(ruleId); | ||
}; | ||
|
||
return ( | ||
<React.Fragment> | ||
<UniversalSelect | ||
className={classes.select} | ||
options={rules.map(rule => ({ | ||
value: rule.id.toString(), | ||
label: rule.code | ||
}))} | ||
value={ruleId} | ||
onChange={handleSetRule} | ||
name={"Rule"} | ||
/> | ||
|
||
<RuleView rule={rule} rules={rules} setRuleId={setRuleId} /> | ||
</React.Fragment> | ||
); | ||
}; | ||
RuleViewContainer.propTypes = { | ||
rules: PropTypes.arrayOf( | ||
PropTypes.shape({ | ||
id: PropTypes.number, | ||
// filter: PropTypes.string.isRequired, | ||
// length: PropTypes.number.isRequired, | ||
code: PropTypes.string.isRequired | ||
}) | ||
) | ||
}; | ||
|
||
export default RuleViewContainer; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...src/components/Button/EditToggleButton.js → ...rc/components/Button/EditToggleButton.jsx
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
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
client/src/components/Button/SaveButton.js → client/src/components/Button/SaveButton.jsx
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,32 @@ | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import Button from "./Button"; | ||
|
||
const SubmitButton = ({ id, onClick, isDisabled, isDisplayed, color }) => { | ||
return ( | ||
<> | ||
<Button | ||
type="input" | ||
color={color} | ||
onClick={onClick} | ||
id={id} | ||
data-testid={id} | ||
disabled={isDisabled} | ||
isDisplayed={isDisplayed} | ||
> | ||
SUBMIT | ||
</Button> | ||
</> | ||
); | ||
}; | ||
|
||
SubmitButton.propTypes = { | ||
children: PropTypes.object, | ||
onClick: PropTypes.func.isRequired, | ||
id: PropTypes.string.isRequired, | ||
color: PropTypes.string, | ||
isDisabled: PropTypes.bool, | ||
isDisplayed: PropTypes.bool.isRequired | ||
}; | ||
|
||
export default SubmitButton; |
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
Oops, something went wrong.