Skip to content

Commit

Permalink
feat: allow full width header
Browse files Browse the repository at this point in the history
  • Loading branch information
rpenido committed Sep 5, 2024
1 parent a0d7fd7 commit 484aa8e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 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 @@ -68,7 +68,7 @@
},
"peerDependencies": {
"@edx/frontend-platform": "^7.0.0 || ^8.0.0",
"@openedx/paragon": ">= 21.5.7 < 23.0.0",
"@openedx/paragon": "git+ssh://github.com/open-craft/paragon#rpenido/dist/fal-3820-add-full-width-container-option",
"prop-types": "^15.5.10",
"react": "^16.9.0 || ^17.0.0",
"react-dom": "^16.9.0 || ^17.0.0"
Expand Down
5 changes: 4 additions & 1 deletion src/studio-header/HeaderBody.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const HeaderBody = ({
mainMenuDropdowns,
outlineLink,
searchButtonAction,
full,
}) => {
const intl = useIntl();

Expand All @@ -51,7 +52,7 @@ const HeaderBody = ({
);

return (
<Container size="xl" className="px-2.5">
<Container size={full ? undefined : 'xl'} className="px-2.5">
<ActionRow as="header">
{isHiddenMainMenu ? (
<Row className="flex-nowrap ml-4">
Expand Down Expand Up @@ -155,6 +156,7 @@ HeaderBody.propTypes = {
})),
outlineLink: PropTypes.string,
searchButtonAction: PropTypes.func,
full: PropTypes.bool,
};

HeaderBody.defaultProps = {
Expand All @@ -174,6 +176,7 @@ HeaderBody.defaultProps = {
mainMenuDropdowns: [],
outlineLink: null,
searchButtonAction: null,
full: false,
};

export default HeaderBody;
5 changes: 4 additions & 1 deletion src/studio-header/StudioHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ensureConfig([
], 'Studio Header component');

const StudioHeader = ({
number, org, title, isHiddenMainMenu, mainMenuDropdowns, outlineLink, searchButtonAction,
number, org, title, full, isHiddenMainMenu, mainMenuDropdowns, outlineLink, searchButtonAction,
}) => {
const { authenticatedUser, config } = useContext(AppContext);
const props = {
Expand All @@ -25,6 +25,7 @@ const StudioHeader = ({
number,
org,
title,
full,
username: authenticatedUser?.username,
isAdmin: authenticatedUser?.administrator,
authenticatedUserAvatar: authenticatedUser?.avatar,
Expand Down Expand Up @@ -53,6 +54,7 @@ StudioHeader.propTypes = {
number: PropTypes.string,
org: PropTypes.string,
title: PropTypes.string.isRequired,
full: PropTypes.bool,
isHiddenMainMenu: PropTypes.bool,
mainMenuDropdowns: PropTypes.arrayOf(PropTypes.shape({
id: PropTypes.string,
Expand All @@ -69,6 +71,7 @@ StudioHeader.propTypes = {
StudioHeader.defaultProps = {
number: '',
org: '',
full: false,
isHiddenMainMenu: false,
mainMenuDropdowns: [],
outlineLink: null,
Expand Down

0 comments on commit 484aa8e

Please sign in to comment.