From 8a5825d52271d712ec7c8348447d433067e13ef2 Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Thu, 13 Sep 2018 14:18:56 -0400 Subject: DONE --- .../frontend/components/ErrorMessage.js | 51 ---------------------- 1 file changed, 51 deletions(-) delete mode 100644 finished-application/frontend/components/ErrorMessage.js (limited to 'finished-application/frontend/components/ErrorMessage.js') diff --git a/finished-application/frontend/components/ErrorMessage.js b/finished-application/frontend/components/ErrorMessage.js deleted file mode 100644 index 52d59a8..0000000 --- a/finished-application/frontend/components/ErrorMessage.js +++ /dev/null @@ -1,51 +0,0 @@ -import styled from 'styled-components'; -import React from 'react'; - -import PropTypes from 'prop-types'; - -const ErrorStyles = styled.div` - padding: 2rem; - background: white; - margin: 2rem 0; - border: 1px solid rgba(0, 0, 0, 0.05); - border-left: 5px solid red; - p { - margin: 0; - font-weight: 100; - } - strong { - margin-right: 1rem; - } -`; - -const DisplayError = ({ error }) => { - if (!error || !error.message) return null; - if (error.networkError && error.networkError.result && error.networkError.result.errors.length) { - return error.networkError.result.errors.map((error, i) => ( - -

- Shoot! - {error.message.replace('GraphQL error: ', '')} -

-
- )); - } - return ( - -

- Shoot! - {error.message.replace('GraphQL error: ', '')} -

-
- ); -}; - -DisplayError.defaultProps = { - error: {}, -}; - -DisplayError.propTypes = { - error: PropTypes.object, -}; - -export default DisplayError; -- cgit v1.3