Skip to content

Commit

Permalink
feat: expose containerProps in StudioFooter [FC-0062] (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
rpenido authored Oct 1, 2024
1 parent 2d5f5fe commit cc647e7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
6 changes: 3 additions & 3 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 @@ -40,7 +40,7 @@
"@edx/reactifex": "^2.1.1",
"@openedx/frontend-build": "14.1.5",
"@openedx/frontend-plugin-framework": "^1.1.2",
"@openedx/paragon": "22.8.1",
"@openedx/paragon": "^22.8.1",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^12.1.1",
"husky": "8.0.3",
Expand All @@ -59,6 +59,7 @@
"@fortawesome/free-regular-svg-icons": "6.6.0",
"@fortawesome/free-solid-svg-icons": "6.6.0",
"@fortawesome/react-fontawesome": "0.2.2",
"classnames": "^2.5.1",
"jest-environment-jsdom": "^29.7.0",
"lodash": "^4.17.21",
"ts-jest": "^29.1.2"
Expand Down
26 changes: 19 additions & 7 deletions src/components/studio-footer/StudioFooter.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useContext, useState } from 'react';
import _ from 'lodash';
import { intlShape, injectIntl, FormattedMessage } from '@edx/frontend-platform/i18n';
import { useIntl, FormattedMessage } from '@edx/frontend-platform/i18n';
import { ensureConfig } from '@edx/frontend-platform';
import { AppContext } from '@edx/frontend-platform/react';
import {
Expand All @@ -12,6 +12,9 @@ import {
TransitionReplace,
} from '@openedx/paragon';
import { ExpandLess, ExpandMore, Help } from '@openedx/paragon/icons';
import classNames from 'classnames';
import PropTypes from 'prop-types';

import messages from './messages';

ensureConfig([
Expand All @@ -26,12 +29,14 @@ ensureConfig([
], 'Studio Footer component');

const StudioFooter = ({
// injected
intl,
containerProps,
}) => {
const intl = useIntl();
const [isOpen, setIsOpen] = useState(false);
const { config } = useContext(AppContext);

const { containerClassName, ...restContainerProps } = containerProps || {};

return (
<>
<div className="m-0 mt-6 row align-items-center justify-content-center">
Expand All @@ -49,7 +54,11 @@ const StudioFooter = ({
</Button>
<div className="col border-top ml-2" />
</div>
<Container size="xl" className="px-4">
<Container
size="xl"
className={classNames('px-4', containerClassName)}
{...restContainerProps}
>
<TransitionReplace>
{isOpen ? (
<ActionRow key="help-link-button-row" className="py-4" data-testid="helpButtonRow">
Expand Down Expand Up @@ -139,8 +148,11 @@ const StudioFooter = ({
};

StudioFooter.propTypes = {
// injected
intl: intlShape.isRequired,
containerProps: PropTypes.shape(Container.propTypes),
};

StudioFooter.defaultProps = {
containerProps: {},
};

export default injectIntl(StudioFooter);
export default StudioFooter;

0 comments on commit cc647e7

Please sign in to comment.