Skip to content

Commit f2c236c

Browse files
fix: remove logo URL
1 parent db912e6 commit f2c236c

File tree

3 files changed

+18
-31
lines changed

3 files changed

+18
-31
lines changed

docs/using_custom_header.rst

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Custom Header Component
66
Overview
77
--------
88

9-
The ``Header`` component is used to display a header with a provided ``logo``, ``mainMenuItems``,
9+
The ``Header`` component is used to display a header with a provided ``mainMenuItems``,
1010
``secondaryMenuItems``, and ``userMenuItems`` props. If props are provided, the component will use them; otherwise,
11-
If any of the props ``(logo, mainMenuItems, secondaryMenuItems, userMenuItems)`` are not provided, default
11+
If any of the props ``(mainMenuItems, secondaryMenuItems, userMenuItems)`` are not provided, default
1212
items are displayed. This component provides flexibility in customization, making it suitable for a wide
1313
range of applications.
1414

@@ -17,21 +17,6 @@ Props Details
1717

1818
The `Header` component accepts the following **optional** props for customization:
1919

20-
``logo``
21-
*******
22-
23-
The logo prop is an object containing `src`, `alt`, and `href` properties. If not passed, LOGO_URL from config will be used.
24-
It is displayed on the left of the header in the desktop screen and in the center of the header on the mobile screen.
25-
26-
Example:
27-
::
28-
29-
{
30-
src: 'path/to/logo.png',
31-
alt: 'Logo Alt Text',
32-
href: '/home'
33-
}
34-
3520
``mainMenuItems``
3621
*****************
3722

@@ -66,7 +51,7 @@ Example:
6651
secondaryMenuItems
6752
******************
6853

69-
The secondary menu items has same structure as ``mainMenuItems``. On desktop screen, These items are displayed on the right of header just before the userMenu avatar and on mobile screen,
54+
The secondary menu items has same structure as ``mainMenuItems``. On desktop screen, these items are displayed on the right of header just before the userMenu avatar and on mobile screen,
7055
these items are displayed below the mainMenu items in dropdown.
7156

7257
Example:

src/Header.jsx

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,18 @@ subscribe(APP_CONFIG_INITIALIZED, () => {
3333

3434
/**
3535
* Header component for the application.
36-
* Displays a header with the provided logo, main menu, secondary menu, and user menu when the user is authenticated.
37-
* If any of the props (logo, mainMenuItems, secondaryMenuItems, userMenuItems) are not provided, default
36+
* Displays a header with the provided main menu, secondary menu, and user menu when the user is authenticated.
37+
* If any of the props (mainMenuItems, secondaryMenuItems, userMenuItems) are not provided, default
3838
* items are displayed.
3939
* For more details on how to use this component, please refer to this document:
4040
* https://github.com/openedx/frontend-component-header/blob/master/docs/using_custom_header.rst
4141
*
42-
* @param logo
4342
* @param mainMenuItems
4443
* @param secondaryMenuItems
4544
* @param userMenuItems
4645
*/
4746
const Header = ({
48-
intl, logo, mainMenuItems, secondaryMenuItems, userMenuItems,
47+
intl, mainMenuItems, secondaryMenuItems, userMenuItems,
4948
}) => {
5049
const { authenticatedUser, config } = useContext(AppContext);
5150

@@ -106,9 +105,9 @@ const Header = ({
106105
];
107106

108107
const props = {
109-
logo: logo?.src || config.LOGO_URL,
110-
logoAltText: logo?.alt || config.SITE_NAME,
111-
logoDestination: logo?.href || `${config.LMS_BASE_URL}/dashboard`,
108+
logo: config.LOGO_URL,
109+
logoAltText: config.SITE_NAME,
110+
logoDestination: `${config.LMS_BASE_URL}/dashboard`,
112111
loggedIn: authenticatedUser !== null,
113112
username: authenticatedUser !== null ? authenticatedUser.username : null,
114113
avatar: authenticatedUser !== null ? authenticatedUser.avatar : null,
@@ -131,19 +130,13 @@ const Header = ({
131130
};
132131

133132
Header.defaultProps = {
134-
logo: null,
135133
mainMenuItems: null,
136134
secondaryMenuItems: null,
137135
userMenuItems: null,
138136
};
139137

140138
Header.propTypes = {
141139
intl: intlShape.isRequired,
142-
logo: PropTypes.shape({
143-
src: PropTypes.string,
144-
alt: PropTypes.string,
145-
href: PropTypes.string,
146-
}),
147140
mainMenuItems: PropTypes.oneOfType([
148141
PropTypes.node,
149142
PropTypes.array,

src/index.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,15 @@ $white: #fff;
8888
height: 100%;
8989
}
9090
}
91+
.secondary-menu-container {
92+
.nav-link:hover,
93+
.nav-link:focus,
94+
.nav-link.active,
95+
.expanded .nav-link {
96+
background: $component-active-bg;
97+
color: $component-active-color;
98+
}
99+
}
91100
.main-nav {
92101
.nav-link {
93102
padding: 1.125rem 1rem;

0 commit comments

Comments
 (0)