Sha256: f55703520e3053f2f4b1d1c31b0c0fb9fe0c70b2246c137ea3dd6e796fb5c95b

Contents?: true

Size: 1.84 KB

Versions: 5

Compression:

Stored size: 1.84 KB

Contents

// eslint-disable-next-line no-unused-vars
function LessonCard(props) {
  const url = props.lesson.path;
  const is_prereq = props.lesson.is_prerequisite;
  const is_foundational = props.lesson.is_foundational;
  const is_opr = props.lesson.is_opr;
  const opr_standards = props.lesson.opr_standards;

  let title;
  if (is_opr) {
    title = 'PREREQUISITE LESSON';
  } else if (is_prereq) {
    const numeral = (/lesson (.*)/i).exec(props.lesson.short_title)[1];
    title = `LESSON ${numeral.toLowerCase()} • Prerequisite`;
  } else {
    title = props.with_breadcrumb ? props.lesson.breadcrumb_title : props.lesson.short_title.toUpperCase();
  }

  const prereq = <div className="o-lesson-card__header--prerequisite"></div>;

  return (
    <a className="o-lesson-card o-lesson-card--base" href={url}>
      <div className={classNames('o-lesson-card__wrap', `cs-bg--${props.colorCode}`)}>
        <div className="o-lesson-card__header cs-txt--light">
          {is_prereq || is_opr ? prereq : null}
          <span className="o-lesson-card__header--title u-txt--breadcrumbs">{title}</span>
        </div>
        <div className="o-lesson-card__content o-lesson-card__content--base cs-bg--light">
          <h3 className="o-lesson-card__dsc o-lesson-card__dsc--short">{is_foundational ? '' : props.lesson.title}</h3>
          <div className="o-lesson-card__duration u-hidden">
            <TimeToTeach duration={props.lesson.time_to_teach} />
          </div>
        </div>
        <div className="o-lesson-card__content o-lesson-card__content--hover">
          <div className="o-lesson-card__dsc o-lesson-card__dsc--full">
            { opr_standards &&
              <span className="u-txt--lesson-hover-standard u-text--uppercase">{opr_standards}<br/><br/></span>
            }
            {props.lesson.teaser}
          </div>
        </div>
      </div>
    </a>
  );
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lcms-engine-0.1.4 app/assets/javascripts/lcms/engine/components/lesson-card/LessonCard.js.jsx
lcms-engine-0.1.3 app/assets/javascripts/lcms/engine/components/lesson-card/LessonCard.js.jsx
lcms-engine-0.2.0 app/assets/javascripts/lcms/engine/components/lesson-card/LessonCard.js.jsx
lcms-engine-0.1.2 app/assets/javascripts/lcms/engine/components/lesson-card/LessonCard.js.jsx
lcms-engine-0.1.0 app/assets/javascripts/lcms/engine/components/lesson-card/LessonCard.js.jsx