Skip to content

Commit 36c5fd8

Browse files
committed
feat: expose containerProps in StudioFooter
1 parent 6b3a49c commit 36c5fd8

File tree

3 files changed

+22
-10
lines changed

3 files changed

+22
-10
lines changed

package-lock.json

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"peerDependencies": {
6767
"@edx/frontend-platform": "^7.0.0 || ^8.0.0",
6868
"@openedx/paragon": ">= 21.11.3 < 23.0.0",
69+
"classnames": "^2.5.1",
6970
"prop-types": "^15.5.10",
7071
"react": "^16.9.0 || ^17.0.0",
7172
"react-dom": "^16.9.0 || ^17.0.0"

src/components/studio-footer/StudioFooter.jsx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useContext, useState } from 'react';
22
import _ from 'lodash';
3-
import { intlShape, injectIntl, FormattedMessage } from '@edx/frontend-platform/i18n';
3+
import { useIntl, FormattedMessage } from '@edx/frontend-platform/i18n';
44
import { ensureConfig } from '@edx/frontend-platform';
55
import { AppContext } from '@edx/frontend-platform/react';
66
import {
@@ -12,6 +12,8 @@ import {
1212
TransitionReplace,
1313
} from '@openedx/paragon';
1414
import { ExpandLess, ExpandMore, Help } from '@openedx/paragon/icons';
15+
import classNames from 'classnames';
16+
1517
import messages from './messages';
1618

1719
ensureConfig([
@@ -26,12 +28,14 @@ ensureConfig([
2628
], 'Studio Footer component');
2729

2830
const StudioFooter = ({
29-
// injected
30-
intl,
31+
containerProps,
3132
}) => {
33+
const intl = useIntl();
3234
const [isOpen, setIsOpen] = useState(false);
3335
const { config } = useContext(AppContext);
3436

37+
const { containerClassName, ...restContainerProps } = containerProps || {};
38+
3539
return (
3640
<>
3741
<div className="m-0 mt-6 row align-items-center justify-content-center">
@@ -49,7 +53,11 @@ const StudioFooter = ({
4953
</Button>
5054
<div className="col border-top ml-2" />
5155
</div>
52-
<Container size="xl" className="px-4">
56+
<Container
57+
size="xl"
58+
className={classNames('px-4', containerClassName)}
59+
{...restContainerProps}
60+
>
5361
<TransitionReplace>
5462
{isOpen ? (
5563
<ActionRow key="help-link-button-row" className="py-4" data-testid="helpButtonRow">
@@ -139,8 +147,10 @@ const StudioFooter = ({
139147
};
140148

141149
StudioFooter.propTypes = {
142-
// injected
143-
intl: intlShape.isRequired,
150+
containerProps: Container.propTypes,
151+
};
152+
153+
StudioFooter.defaultProps = {
144154
};
145155

146-
export default injectIntl(StudioFooter);
156+
export default StudioFooter;

0 commit comments

Comments
 (0)