Files
create-react-app/packages/react-error-overlay/src/containers/CompileErrorContainer.js
Sophie Alpert 2e82ebb337 BSD+Patents -> MIT (#3189)
* File headers BSD+Patents -> MIT

* BSD+Patents -> MIT
2017-09-26 10:30:05 +01:00

34 lines
962 B
JavaScript

/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/* @flow */
import React, { PureComponent } from 'react';
import ErrorOverlay from '../components/ErrorOverlay';
import Footer from '../components/Footer';
import Header from '../components/Header';
import CodeBlock from '../components/CodeBlock';
import generateAnsiHTML from '../utils/generateAnsiHTML';
type Props = {|
error: string,
|};
class CompileErrorContainer extends PureComponent<Props, void> {
render() {
const { error } = this.props;
return (
<ErrorOverlay>
<Header headerText="Failed to compile" />
<CodeBlock main={true} codeHTML={generateAnsiHTML(error)} />
<Footer line1="This error occurred during the build time and cannot be dismissed." />
</ErrorOverlay>
);
}
}
export default CompileErrorContainer;