TNL-7126 BD-29 Visual Updates to Learning Sequence (#88)

* BB-2569: Use faVideo instead of faFilm for video units; Set page title based on section, sequence, and course titles

* Add CourseLicense component with styling

* Reorder the pageTitleBreadCrumbs that are used for setting the page title

* Revert "Add CourseLicense component with styling"

This reverts commit 8d154998de.

* Fix package-lock.json so that only new changes for react-helmet are included
This commit is contained in:
Patrick Cockwell
2020-06-24 03:09:12 +07:00
committed by GitHub
parent 534b9b205f
commit 8b34f8c792
4 changed files with 35 additions and 2 deletions

View File

@@ -1,5 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Helmet } from 'react-helmet';
import { getConfig } from '@edx/frontend-platform';
import { AlertList } from '../../user-messages';
import { useAccessExpirationAlert } from '../../alerts/access-expiration-alert';
@@ -35,6 +37,12 @@ function Course({
const sequence = useModel('sequences', sequenceId);
const section = useModel('sections', sequence ? sequence.sectionId : null);
const pageTitleBreadCrumbs = [
sequence,
section,
course,
].filter(element => element != null).map(element => element.title);
useOfferAlert(courseId);
useAccessExpirationAlert(courseId);
@@ -49,6 +57,9 @@ function Course({
return (
<>
<Helmet>
<title>{`${pageTitleBreadCrumbs.join(' | ')} | ${getConfig().SITE_NAME}`}</title>
</Helmet>
<AlertList
className="my-3"
topic="course"

View File

@@ -2,14 +2,14 @@ import React from 'react';
import PropTypes from 'prop-types';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import {
faFilm, faBook, faEdit, faTasks, faLock,
faVideo, faBook, faEdit, faTasks, faLock,
} from '@fortawesome/free-solid-svg-icons';
export default function UnitIcon({ type }) {
let icon = null;
switch (type) {
case 'video':
icon = faFilm;
icon = faVideo;
break;
case 'other':
icon = faBook;