UNPKG

ndla-ui

Version:

UI component library for NDLA.

55 lines (48 loc) 2.08 kB
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /** * Copyright (c) 2016-present, NDLA. * * This source code is licensed under the GPLv3 license found in the * LICENSE file in the root directory of this source tree. * */ import React from 'react'; import PropTypes from 'prop-types'; import BEMHelper from 'react-bem-helper'; import { ContentTypeShape } from '../shapes'; import * as contentTypes from '../model/ContentType'; var classes = new BEMHelper({ name: 'hero', prefix: 'c-' }); export var Hero = function Hero(_ref) { var children = _ref.children, contentType = _ref.contentType; return React.createElement( 'div', classes('', contentType), children || null ); }; Hero.propTypes = { contentType: ContentTypeShape, children: PropTypes.node }; export var SubjectMaterialHero = function SubjectMaterialHero(props) { return React.createElement(Hero, _extends({ contentType: contentTypes.SUBJECT_MATERIAL }, props)); }; export var TasksAndActivitiesHero = function TasksAndActivitiesHero(props) { return React.createElement(Hero, _extends({ contentType: contentTypes.TASKS_AND_ACTIVITIES }, props)); }; export var AssessmentResourcesHero = function AssessmentResourcesHero(props) { return React.createElement(Hero, _extends({ contentType: contentTypes.ASSESSMENT_RESOURCES }, props)); }; export var SubjectHero = function SubjectHero(props) { return React.createElement(Hero, _extends({ contentType: contentTypes.SUBJECT }, props)); }; export var ExternalLearningResourcesHero = function ExternalLearningResourcesHero(props) { return React.createElement(Hero, _extends({ contentType: contentTypes.EXTERNAL_LEARNING_RESOURCES }, props)); }; export var SourceMaterialHero = function SourceMaterialHero(props) { return React.createElement(Hero, _extends({ contentType: contentTypes.SOURCE_MATERIAL }, props)); };