Skip to content

Commit ba30f8b

Browse files
committed
feat: allow full width header
1 parent a0d7fd7 commit ba30f8b

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
},
6969
"peerDependencies": {
7070
"@edx/frontend-platform": "^7.0.0 || ^8.0.0",
71-
"@openedx/paragon": ">= 21.5.7 < 23.0.0",
71+
"@openedx/paragon": "git+ssh://github.com/open-craft/paragon#rpenido/dist/fal-3820-add-full-width-container-option",
7272
"prop-types": "^15.5.10",
7373
"react": "^16.9.0 || ^17.0.0",
7474
"react-dom": "^16.9.0 || ^17.0.0"

src/studio-header/HeaderBody.jsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const HeaderBody = ({
3737
mainMenuDropdowns,
3838
outlineLink,
3939
searchButtonAction,
40+
full,
4041
}) => {
4142
const intl = useIntl();
4243

@@ -51,7 +52,7 @@ const HeaderBody = ({
5152
);
5253

5354
return (
54-
<Container size="xl" className="px-2.5">
55+
<Container size={full ? undefined : 'xl'} className="px-2.5">
5556
<ActionRow as="header">
5657
{isHiddenMainMenu ? (
5758
<Row className="flex-nowrap ml-4">
@@ -110,6 +111,7 @@ const HeaderBody = ({
110111
iconAs={Icon}
111112
onClick={searchButtonAction}
112113
aria-label={intl.formatMessage(messages['header.label.search.nav'])}
114+
alt={intl.formatMessage(messages['header.label.search.nav'])}
113115
/>
114116
</Nav>
115117
)}
@@ -155,6 +157,7 @@ HeaderBody.propTypes = {
155157
})),
156158
outlineLink: PropTypes.string,
157159
searchButtonAction: PropTypes.func,
160+
full: PropTypes.bool,
158161
};
159162

160163
HeaderBody.defaultProps = {
@@ -174,6 +177,7 @@ HeaderBody.defaultProps = {
174177
mainMenuDropdowns: [],
175178
outlineLink: null,
176179
searchButtonAction: null,
180+
full: false,
177181
};
178182

179183
export default HeaderBody;

src/studio-header/NavDropdownMenu.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const NavDropdownMenu = ({
3030

3131
NavDropdownMenu.propTypes = {
3232
id: PropTypes.string.isRequired,
33-
buttonTitle: PropTypes.string.isRequired,
33+
buttonTitle: PropTypes.node.isRequired,
3434
items: PropTypes.arrayOf(PropTypes.shape({
3535
href: PropTypes.string,
3636
title: PropTypes.string,

src/studio-header/StudioHeader.jsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ensureConfig([
1616
], 'Studio Header component');
1717

1818
const StudioHeader = ({
19-
number, org, title, isHiddenMainMenu, mainMenuDropdowns, outlineLink, searchButtonAction,
19+
number, org, title, full, isHiddenMainMenu, mainMenuDropdowns, outlineLink, searchButtonAction,
2020
}) => {
2121
const { authenticatedUser, config } = useContext(AppContext);
2222
const props = {
@@ -25,6 +25,7 @@ const StudioHeader = ({
2525
number,
2626
org,
2727
title,
28+
full,
2829
username: authenticatedUser?.username,
2930
isAdmin: authenticatedUser?.administrator,
3031
authenticatedUserAvatar: authenticatedUser?.avatar,
@@ -53,6 +54,7 @@ StudioHeader.propTypes = {
5354
number: PropTypes.string,
5455
org: PropTypes.string,
5556
title: PropTypes.string.isRequired,
57+
full: PropTypes.bool,
5658
isHiddenMainMenu: PropTypes.bool,
5759
mainMenuDropdowns: PropTypes.arrayOf(PropTypes.shape({
5860
id: PropTypes.string,
@@ -69,6 +71,7 @@ StudioHeader.propTypes = {
6971
StudioHeader.defaultProps = {
7072
number: '',
7173
org: '',
74+
full: false,
7275
isHiddenMainMenu: false,
7376
mainMenuDropdowns: [],
7477
outlineLink: null,

0 commit comments

Comments
 (0)