[clean up][xs]: removed unnecessary imports.
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
import ErrorMessage from '../Error';
|
import ErrorMessage from '../Error';
|
||||||
import { NetworkStatus } from 'apollo-client';
|
|
||||||
import { useQuery } from '@apollo/react-hooks';
|
import { useQuery } from '@apollo/react-hooks';
|
||||||
import gql from 'graphql-tag';
|
import gql from 'graphql-tag';
|
||||||
|
|
||||||
@@ -21,16 +20,13 @@ export const GET_DATAPACKAGE_QUERY = gql`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
export default function About({ variables }) {
|
export default function About({ variables }) {
|
||||||
const { loading, error, data, fetchMore, networkStatus } = useQuery(
|
const { loading, error, data } = useQuery(GET_DATAPACKAGE_QUERY, {
|
||||||
GET_DATAPACKAGE_QUERY,
|
variables,
|
||||||
{
|
// Setting this value to true will make the component rerender when
|
||||||
variables,
|
// the "networkStatus" changes, so we are able to know if it is fetching
|
||||||
// Setting this value to true will make the component rerender when
|
// more data
|
||||||
// the "networkStatus" changes, so we are able to know if it is fetching
|
notifyOnNetworkStatusChange: true,
|
||||||
// more data
|
});
|
||||||
notifyOnNetworkStatusChange: true,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
if (error) return <ErrorMessage message="Error loading dataset." />;
|
if (error) return <ErrorMessage message="Error loading dataset." />;
|
||||||
if (loading) return <div>Loading</div>;
|
if (loading) return <div>Loading</div>;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import ErrorMessage from '../Error';
|
import ErrorMessage from '../Error';
|
||||||
import { NetworkStatus } from 'apollo-client';
|
|
||||||
import { useQuery } from '@apollo/react-hooks';
|
import { useQuery } from '@apollo/react-hooks';
|
||||||
import gql from 'graphql-tag';
|
import gql from 'graphql-tag';
|
||||||
|
|
||||||
@@ -19,16 +18,13 @@ export const GET_ORG_QUERY = gql`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
export default function Org({ variables }) {
|
export default function Org({ variables }) {
|
||||||
const { loading, error, data, fetchMore, networkStatus } = useQuery(
|
const { loading, error, data } = useQuery(GET_ORG_QUERY, {
|
||||||
GET_ORG_QUERY,
|
variables,
|
||||||
{
|
// Setting this value to true will make the component rerender when
|
||||||
variables,
|
// the "networkStatus" changes, so we are able to know if it is fetching
|
||||||
// Setting this value to true will make the component rerender when
|
// more data
|
||||||
// the "networkStatus" changes, so we are able to know if it is fetching
|
notifyOnNetworkStatusChange: true,
|
||||||
// more data
|
});
|
||||||
notifyOnNetworkStatusChange: true,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
if (error) return <ErrorMessage message="Error loading dataset." />;
|
if (error) return <ErrorMessage message="Error loading dataset." />;
|
||||||
if (loading) return <div>Loading</div>;
|
if (loading) return <div>Loading</div>;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import ErrorMessage from '../Error';
|
import ErrorMessage from '../Error';
|
||||||
import { NetworkStatus } from 'apollo-client';
|
|
||||||
import { useQuery } from '@apollo/react-hooks';
|
import { useQuery } from '@apollo/react-hooks';
|
||||||
import gql from 'graphql-tag';
|
import gql from 'graphql-tag';
|
||||||
|
|
||||||
@@ -22,16 +21,13 @@ export const GET_DATAPACKAGE_QUERY = gql`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
export default function Resources({ variables }) {
|
export default function Resources({ variables }) {
|
||||||
const { loading, error, data, fetchMore, networkStatus } = useQuery(
|
const { loading, error, data } = useQuery(GET_DATAPACKAGE_QUERY, {
|
||||||
GET_DATAPACKAGE_QUERY,
|
variables,
|
||||||
{
|
// Setting this value to true will make the component rerender when
|
||||||
variables,
|
// the "networkStatus" changes, so we are able to know if it is fetching
|
||||||
// Setting this value to true will make the component rerender when
|
// more data
|
||||||
// the "networkStatus" changes, so we are able to know if it is fetching
|
notifyOnNetworkStatusChange: true,
|
||||||
// more data
|
});
|
||||||
notifyOnNetworkStatusChange: true,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
if (error) return <ErrorMessage message="Error loading dataset." />;
|
if (error) return <ErrorMessage message="Error loading dataset." />;
|
||||||
if (loading) return <div>Loading</div>;
|
if (loading) return <div>Loading</div>;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import ErrorMessage from '../Error';
|
import ErrorMessage from '../Error';
|
||||||
import { NetworkStatus } from 'apollo-client';
|
|
||||||
import { useQuery } from '@apollo/react-hooks';
|
import { useQuery } from '@apollo/react-hooks';
|
||||||
import gql from 'graphql-tag';
|
import gql from 'graphql-tag';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import ErrorMessage from '../Error';
|
import ErrorMessage from '../Error';
|
||||||
import { NetworkStatus } from 'apollo-client';
|
|
||||||
import { useQuery } from '@apollo/react-hooks';
|
import { useQuery } from '@apollo/react-hooks';
|
||||||
import gql from 'graphql-tag';
|
import gql from 'graphql-tag';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import Item from './Item';
|
import Item from './Item';
|
||||||
import ErrorMessage from '../Error';
|
import ErrorMessage from '../Error';
|
||||||
import { NetworkStatus } from 'apollo-client';
|
|
||||||
import { useQuery } from '@apollo/react-hooks';
|
import { useQuery } from '@apollo/react-hooks';
|
||||||
import gql from 'graphql-tag';
|
import gql from 'graphql-tag';
|
||||||
|
|
||||||
@@ -23,7 +22,7 @@ const QUERY = gql`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
export default function List({ variables }) {
|
export default function List({ variables }) {
|
||||||
const { loading, error, data, fetchMore, networkStatus } = useQuery(QUERY, {
|
const { loading, error, data } = useQuery(QUERY, {
|
||||||
variables,
|
variables,
|
||||||
// Setting this value to true will make the component rerender when
|
// Setting this value to true will make the component rerender when
|
||||||
// the "networkStatus" changes, so we are able to know if it is fetching
|
// the "networkStatus" changes, so we are able to know if it is fetching
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import ErrorMessage from '../Error';
|
||||||
import { useQuery } from '@apollo/react-hooks';
|
import { useQuery } from '@apollo/react-hooks';
|
||||||
import gql from 'graphql-tag';
|
import gql from 'graphql-tag';
|
||||||
|
|
||||||
@@ -21,6 +22,7 @@ export default function Total({ variables }) {
|
|||||||
notifyOnNetworkStatusChange: true,
|
notifyOnNetworkStatusChange: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (error) return <ErrorMessage message="Error loading search results." />;
|
||||||
if (loading) return <div>Loading</div>;
|
if (loading) return <div>Loading</div>;
|
||||||
|
|
||||||
const { result } = data.search;
|
const { result } = data.search;
|
||||||
|
|||||||
Reference in New Issue
Block a user