Skip to content

Commit

Permalink
feat: expose containerProps in StudioFooter
Browse files Browse the repository at this point in the history
  • Loading branch information
rpenido committed Sep 18, 2024
1 parent 6b3a49c commit 36c5fd8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
7 changes: 4 additions & 3 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"peerDependencies": {
"@edx/frontend-platform": "^7.0.0 || ^8.0.0",
"@openedx/paragon": ">= 21.11.3 < 23.0.0",
"classnames": "^2.5.1",
"prop-types": "^15.5.10",
"react": "^16.9.0 || ^17.0.0",
"react-dom": "^16.9.0 || ^17.0.0"
Expand Down
24 changes: 17 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,8 @@ import {
TransitionReplace,
} from '@openedx/paragon';
import { ExpandLess, ExpandMore, Help } from '@openedx/paragon/icons';
import classNames from 'classnames';

import messages from './messages';

ensureConfig([
Expand All @@ -26,12 +28,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 +53,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 +147,10 @@ const StudioFooter = ({
};

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

StudioFooter.defaultProps = {
};

export default injectIntl(StudioFooter);
export default StudioFooter;

0 comments on commit 36c5fd8

Please sign in to comment.