[error component][xs]: move it to top level dir so we can easily use it for other components.
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
export default function ErrorMessage({ message }) {
|
||||
return (
|
||||
<aside>
|
||||
{message}
|
||||
<style jsx>{`
|
||||
aside {
|
||||
padding: 1.5em;
|
||||
font-size: 14px;
|
||||
color: white;
|
||||
background-color: red;
|
||||
}
|
||||
`}</style>
|
||||
</aside>
|
||||
);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import Item from './Item';
|
||||
import ErrorMessage from './Error';
|
||||
import ErrorMessage from '../Error';
|
||||
import { NetworkStatus } from 'apollo-client';
|
||||
import { useQuery } from '@apollo/react-hooks';
|
||||
import gql from 'graphql-tag';
|
||||
@@ -35,7 +35,7 @@ export default function List({ variables }) {
|
||||
}
|
||||
);
|
||||
|
||||
if (error) return <ErrorMessage message="Error loading posts." />;
|
||||
if (error) return <ErrorMessage message="Error loading search results." />;
|
||||
if (loading) return <div>Loading</div>;
|
||||
|
||||
const { result } = data.search;
|
||||
|
||||
Reference in New Issue
Block a user