import React, { PropTypes } from 'react'; import InlineSVG from 'react-inlinesvg'; import { Link } from 'react-router'; const exitUrl = require('../../../images/exit.svg'); class ErrorModal extends React.Component { componentDidMount() { this.errorModal.focus(); } forceAuthentication() { return (

In order to save sketches, you must be logged in. Please  Login  or  Sign Up.

); } staleSession() { return (

It looks like you've been logged out. Please  log in.

); } staleProject() { return (

The project you have attempted to save is out of date. Please refresh the page.

); } render() { return (
{ this.errorModal = element; }} tabIndex="0">

Error

{(() => { // eslint-disable-line if (this.props.type === 'forceAuthentication') { return this.forceAuthentication(); } else if (this.props.type === 'staleSession') { return this.staleSession(); } else if (this.props.type === 'staleProject') { return this.staleProject(); } })()}
); } } ErrorModal.propTypes = { type: PropTypes.string.isRequired, closeModal: PropTypes.func.isRequired }; export default ErrorModal;