import React from 'react'; import PropTypes from 'prop-types'; import * as actions from 'src/js/actions/index.js'; import { connect } from 'react-redux'; import injectSheet from 'react-jss'; import textMarkup from 'src/jss/textMarkup.js'; import dependencies from 'data/licenses.json'; import _ from 'lodash'; import SignUpPay from 'src/js/components/SignUpPay.js'; // import createDebug from 'debug'; // const debug = createDebug('d3d:popup:licenses'); const styles = { content: { gridColumn: '1 / 3' }, ...textMarkup }; class Licenses extends React.Component { static propTypes = { onClose: PropTypes.func.isRequired, routes: PropTypes.array.isRequired, route: PropTypes.object.isRequired, classes: PropTypes.object.isRequired }; render() { const { classes, onClose } = this.props; let licenses = dependencies.map(dep => dep.licenses); licenses = _.flatten(licenses); // some packages contain an array with multiple licenses licenses = licenses.map(license => license.replace(/\*$/, '')); // remove * from licenses, see footnote const uniqLicenses = _.uniq(licenses); return (

Licenses Doodle3D

{dependencies.map(dependency => ( ))}
{dependency.name} {dependency.publisher || ''} {dependency.licenses}

* License was deduced from an other file than package.json (README, LICENSE, COPYING, ...)

Unique licenses found:

); } } export default connect(null, dispatch => ({ onClose: () => dispatch(actions.router.push(`/`)) }))(injectSheet(styles)(Licenses));