Skip to content

Commit

Permalink
fix: organization logo display
Browse files Browse the repository at this point in the history
* fix: platform logo on mobile display
* fix: hide course name on mobile
  • Loading branch information
sandroscosta committed Mar 19, 2024
1 parent 6771e70 commit f7db4d5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ $white: #fff;
.user-dropdown {
.btn {
height: 3rem;
@media (max-width: -1 + map-get($grid-breakpoints, "sm")) {
@media (map-get($grid-breakpoints, "sm")) {
padding: 0 0.5rem;
}
}
Expand Down
19 changes: 13 additions & 6 deletions src/learning-header/LearningHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import AuthenticatedUserDropdown from './AuthenticatedUserDropdown';
import messages from './messages';
import getCourseLogoOrg from './data/api';

import './_header.scss';

function LinkedLogo({
href,
src,
Expand All @@ -28,6 +30,9 @@ LinkedLogo.propTypes = {
alt: PropTypes.string.isRequired,
};

// this feature flag is not included on the frontend-platform, we have to get it directly from ENV
const enabledOrgLogo = process.env.ENABLED_ORG_LOGO || true;

function LearningHeader({
courseOrg, courseTitle, intl, showUserDropdown,
}) {
Expand All @@ -54,17 +59,19 @@ function LearningHeader({
<a className="sr-only sr-only-focusable" href="#main-content">{intl.formatMessage(messages.skipNavLink)}</a>
<div className="container-xl py-2 d-flex align-items-center">
{headerLogo}
<div className="flex-grow-1 course-title-lockup text-center" style={{ lineHeight: 1 }}>
{
<div className="d-none d-md-block flex-grow-1 course-title-lockup">
<div className={`d-md-flex ${enabledOrgLogo && 'align-items-center justify-content-center'} w-100`}>
{enabledOrgLogo ? (

Check failure on line 64 in src/learning-header/LearningHeader.jsx

View workflow job for this annotation

GitHub Actions / tests (12)

Expected indentation of 12 space characters but found 10

Check failure on line 64 in src/learning-header/LearningHeader.jsx

View workflow job for this annotation

GitHub Actions / tests (14)

Expected indentation of 12 space characters but found 10

Check failure on line 64 in src/learning-header/LearningHeader.jsx

View workflow job for this annotation

GitHub Actions / tests (16)

Expected indentation of 12 space characters but found 10
(courseOrg && logoOrg)
&& <img src={logoOrg} alt={`${courseOrg} logo`} style={{ maxHeight: '50px' }} />
}
&& <img src={logoOrg} alt={`${courseOrg} logo`} style={{ maxHeight: '45px' }} />
) : null}
<span

Check failure on line 68 in src/learning-header/LearningHeader.jsx

View workflow job for this annotation

GitHub Actions / tests (12)

Expected indentation of 12 space characters but found 10

Check failure on line 68 in src/learning-header/LearningHeader.jsx

View workflow job for this annotation

GitHub Actions / tests (14)

Expected indentation of 12 space characters but found 10

Check failure on line 68 in src/learning-header/LearningHeader.jsx

View workflow job for this annotation

GitHub Actions / tests (16)

Expected indentation of 12 space characters but found 10
className="d-inline-block course-title font-weight-bold ml-3 overflow-hidden text-nowrap text-left w-25"
style={{ textOverflow: 'ellipsis' }}
className="d-inline-block course-title font-weight-semibold ml-3 text-truncate text-left w-25"
style={{ fontSize: '0.85rem' }}
>
{courseTitle}
</span>
</div>
</div>
{showUserDropdown && authenticatedUser && (
<AuthenticatedUserDropdown
Expand Down
10 changes: 10 additions & 0 deletions src/learning-header/_header.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@import "../../node_modules/bootstrap/scss/bootstrap-grid";
@import "../../node_modules/bootstrap/scss/mixins/breakpoints";

.logo {
img {
@include media-breakpoint-down(sm) {
max-width: 85% !important;
}
}
}

0 comments on commit f7db4d5

Please sign in to comment.