Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update header to be keyboard accessible #597

Merged
merged 2 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions src/studio-header/Avatar.jsx

This file was deleted.

23 changes: 23 additions & 0 deletions src/studio-header/BrandNav.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import PropTypes from 'prop-types';

const BrandNav = ({
studioBaseUrl,
logo,
logoAltText,
}) => (
<a href={studioBaseUrl}>
<img
src={logo}
alt={logoAltText}
className="d-block logo"
/>
</a>
);

BrandNav.propTypes = {
studioBaseUrl: PropTypes.string.isRequired,
logo: PropTypes.string.isRequired,
logoAltText: PropTypes.string.isRequired,
};

export default BrandNav;
54 changes: 54 additions & 0 deletions src/studio-header/CourseLockUp.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import PropTypes from 'prop-types';
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
import {
OverlayTrigger,
Tooltip,
} from '@edx/paragon';
import { getPagePath } from '../utils';
import messages from './messages';

const CourseLockUp = ({
courseId,
courseOrg,
courseNumber,
courseTitle,
// injected
intl,
}) => (
<OverlayTrigger
placement="bottom"
overlay={(
<Tooltip id="course-lock-up">
{courseTitle}
</Tooltip>
)}
>
<a
className="course-title-lockup w-25 mr-2"
href={getPagePath(courseId, process.env.ENABLE_NEW_COURSE_OUTLINE_PAGE, 'course')}
aria-label={intl.formatMessage(messages['header.label.courseOutline'])}
data-testid="course-lock-up-block"
>
<span className="d-block small m-0" data-testid="course-org-number">{courseOrg} {courseNumber}</span>
<span className="d-block m-0 font-weight-bold" data-testid="course-title">{courseTitle}</span>
</a>
</OverlayTrigger>
);

CourseLockUp.propTypes = {
courseId: PropTypes.string,
courseNumber: PropTypes.string,
courseOrg: PropTypes.string,
courseTitle: PropTypes.string,
// injected
intl: intlShape.isRequired,
};

CourseLockUp.defaultProps = {
courseNumber: null,
courseOrg: null,
courseId: null,
courseTitle: null,
};

export default injectIntl(CourseLockUp);
154 changes: 0 additions & 154 deletions src/studio-header/DesktopHeader.jsx

This file was deleted.

Loading