Skip to content

Commit

Permalink
feat: show mobile logo
Browse files Browse the repository at this point in the history
  • Loading branch information
igobranco committed Dec 11, 2024
1 parent 00bc85b commit bc8702e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Environment Variables
frontend-app-authentication in which these menus are considered distractions from the user's task.
* ``ENABLE_HEADER_LANG_SELECTOR`` - A boolean to enable the language selector in the header component.
* ``SITE_SUPPORTED_LANGUAGES`` - A list with all the languages to display in the selector.
* ``LOGO_URL_MOBILE`` - The URL of the site's logo for mobile. This logo is displayed in the header.


Installation
Expand Down
25 changes: 19 additions & 6 deletions src/learning-header/LearningHeader.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useContext, useEffect, useState } from 'react';
import Responsive from 'react-responsive';
import PropTypes from 'prop-types';
import { getConfig } from '@edx/frontend-platform';
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
Expand Down Expand Up @@ -40,12 +41,24 @@ const LearningHeader = ({
});

const headerLogo = (
<LinkedLogo
className="logo"
href={`${getConfig().LMS_BASE_URL}/dashboard`}
src={getConfig().LOGO_URL}
alt={getConfig().SITE_NAME}
/>
<>
<Responsive maxWidth={769}>
<LinkedLogo
className="logo"
href={`${getConfig().LMS_BASE_URL}/dashboard`}
src={getConfig().LOGO_URL_MOBILE || getConfig().LOGO_URL}
alt={getConfig().SITE_NAME}
/>
</Responsive>
<Responsive minWidth={769}>
<LinkedLogo
className="logo"
href={`${getConfig().LMS_BASE_URL}/dashboard`}
src={getConfig().LOGO_URL}
alt={getConfig().SITE_NAME}
/>
</Responsive>
</>
);

return (
Expand Down

0 comments on commit bc8702e

Please sign in to comment.