Skip to content

Commit

Permalink
feat: modal actions
Browse files Browse the repository at this point in the history
feat: Actions
  • Loading branch information
muselesscreator authored Nov 2, 2023
2 parents c0890f9 + 39e2595 commit aedd210
Show file tree
Hide file tree
Showing 50 changed files with 901 additions and 792 deletions.
210 changes: 89 additions & 121 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
"redux-devtools-extension": "^2.13.9",
"redux-logger": "^3.0.6",
"regenerator-runtime": "0.14.0",
"tinymce": "5.10.8"
"tinymce": "5.10.8",
"uuid": "^9.0.1"
},
"devDependencies": {
"@edx/browserslist-config": "^1.1.1",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,45 @@ import { Collapsible } from '@edx/paragon';
import { useIntl } from '@edx/frontend-platform/i18n';
import messages from './messages';

const CollapsibleFeedback = ({ children, stepScore, stepLabel, defaultOpen }) => {
const CollapsibleAssessment = ({
children,
stepScore,
stepLabel,
defaultOpen,
}) => {
const { formatMessage } = useIntl();
const [open, setOpen] = React.useState(defaultOpen);

const toggle = () => setOpen(!open);

return (
<Collapsible
title={
title={(
<h3>
{formatMessage(messages.grade, { stepLabel })}
{formatMessage(
stepScore ? messages.grade : messages.unweightedGrade,
{ stepLabel },
)}
{stepScore && formatMessage(messages.gradePoints, stepScore)}
</h3>
}
)}
open={open}
onToggle={toggle}
>
{children}
</Collapsible>
);
};
CollapsibleFeedback.defaultProps = {};
CollapsibleFeedback.propTypes = {
CollapsibleAssessment.defaultProps = {
defaultOpen: false,
};
CollapsibleAssessment.propTypes = {
stepLabel: PropTypes.string.isRequired,
stepScore: PropTypes.shape({
earned: PropTypes.number,
possible: PropTypes.number,
}),
}).isRequired,
children: PropTypes.node.isRequired,
defaultOpen: PropTypes.bool,
};

export default CollapsibleFeedback;
export default CollapsibleAssessment;
Loading

0 comments on commit aedd210

Please sign in to comment.