Skip to content

Commit

Permalink
feat: allow full width footer
Browse files Browse the repository at this point in the history
  • Loading branch information
rpenido committed Sep 5, 2024
1 parent 8d9178f commit 3b9230d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
},
"peerDependencies": {
"@edx/frontend-platform": "^7.0.0 || ^8.0.0",
"@openedx/paragon": ">= 21.11.3 < 23.0.0",
"@openedx/paragon": "git+ssh://github.com/open-craft/paragon#0e0a66a794fbb6ccf61f7afa9264e096f132cd1b",
"prop-types": "^15.5.10",
"react": "^16.9.0 || ^17.0.0",
"react-dom": "^16.9.0 || ^17.0.0"
Expand Down
19 changes: 12 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 propTypes from 'prop-types';

import messages from './messages';

ensureConfig([
Expand All @@ -26,9 +28,9 @@ ensureConfig([
], 'Studio Footer component');

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

Expand All @@ -49,7 +51,7 @@ const StudioFooter = ({
</Button>
<div className="col border-top ml-2" />
</div>
<Container size="xl" className="px-4">
<Container size={full ? undefined : 'xl'} className="px-4">
<TransitionReplace>
{isOpen ? (
<ActionRow key="help-link-button-row" className="py-4" data-testid="helpButtonRow">
Expand Down Expand Up @@ -139,8 +141,11 @@ const StudioFooter = ({
};

StudioFooter.propTypes = {
// injected
intl: intlShape.isRequired,
full: propTypes.bool,
};

StudioFooter.defaultProps = {
full: false,
};

export default injectIntl(StudioFooter);
export default StudioFooter;

0 comments on commit 3b9230d

Please sign in to comment.