[lint][lg]: fix lint errors
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { useState } from 'react';
|
||||
import { useRouter } from 'next/router';
|
||||
|
||||
export default function Form() {
|
||||
const Form: React.FC = () => {
|
||||
const router = useRouter();
|
||||
const [q, setQ] = useState(router.query.q);
|
||||
const [sort, setSort] = useState(router.query.sort);
|
||||
@@ -48,6 +48,7 @@ export default function Form() {
|
||||
id="field-order-by"
|
||||
name="sort"
|
||||
onChange={handleChange}
|
||||
onBlur={handleChange}
|
||||
value={sort}
|
||||
>
|
||||
<option value="score:desc">Relevance</option>
|
||||
@@ -59,4 +60,6 @@ export default function Form() {
|
||||
</div>
|
||||
</form>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export default Form;
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
/* eslint-disable jsx-a11y/anchor-is-valid */
|
||||
import Link from 'next/link';
|
||||
|
||||
export default function Item({ datapackage }) {
|
||||
const Item: React.FC<{ datapackage: any }> = ({ datapackage }) => {
|
||||
return (
|
||||
<div className="mb-6">
|
||||
<h3 className="text-xl font-semibold">
|
||||
<Link
|
||||
href={`/@${
|
||||
datapackage.organization ? datapackage.organization.name : 'dataset'
|
||||
datapackage.organization
|
||||
? datapackage.organization.name
|
||||
: 'dataset'
|
||||
}/${datapackage.name}`}
|
||||
>
|
||||
<a className="text-primary">
|
||||
@@ -30,4 +33,6 @@ export default function Item({ datapackage }) {
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export default Item;
|
||||
|
||||
@@ -3,7 +3,7 @@ import Item from './Item';
|
||||
import { ErrorMessage } from '../_shared';
|
||||
import { SEARCH_QUERY } from '../../graphql/queries';
|
||||
|
||||
export default function List({ variables }) {
|
||||
const List: React.FC<{ variables: any }> = ({ variables }) => {
|
||||
const { loading, error, data } = useQuery(SEARCH_QUERY, {
|
||||
variables,
|
||||
// Setting this value to true will make the component rerender when
|
||||
@@ -22,4 +22,6 @@ export default function List({ variables }) {
|
||||
))}
|
||||
</ul>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export default List;
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useQuery } from '@apollo/react-hooks';
|
||||
import { ErrorMessage } from '../_shared';
|
||||
import { GET_TOTAL_COUNT_QUERY } from '../../graphql/queries';
|
||||
|
||||
export default function Total({ variables }) {
|
||||
const Total: React.FC<{ variables: any }> = ({ variables }) => {
|
||||
const { loading, error, data } = useQuery(GET_TOTAL_COUNT_QUERY, {
|
||||
variables,
|
||||
// Setting this value to true will make the component rerender when
|
||||
@@ -21,4 +21,6 @@ export default function Total({ variables }) {
|
||||
{result.count} results found
|
||||
</h1>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export default Total;
|
||||
|
||||
Reference in New Issue
Block a user