mirror of
https://github.com/idanoo/autobrr
synced 2025-07-25 17:59:14 +00:00
refactor: web api client and cleanup (#128)
refactor: refactored APIClient.ts with a new fetch wrapper and changed it into an explicit-import. chore: modified package.json not to start browser on "npm run start" chore: cleaned up code, deleted 2mo+ useless old comments. fix: fixed parameter collision in screens/filters/details.tsx fix: override react-select's Select component style to make it consistent. addresses #116 Co-authored-by: anonymous <anonymous>
This commit is contained in:
parent
6d68a5c3b7
commit
b60e5f61c6
17 changed files with 381 additions and 793 deletions
|
@ -1,7 +1,7 @@
|
|||
import * as React from "react";
|
||||
import { useQuery } from "react-query";
|
||||
import { formatDistanceToNowStrict } from "date-fns";
|
||||
import { useTable, useSortBy, usePagination } from "react-table";
|
||||
import { useTable, useSortBy, usePagination, Column } from "react-table";
|
||||
import {
|
||||
ClockIcon,
|
||||
BanIcon,
|
||||
|
@ -15,7 +15,7 @@ import {
|
|||
CheckIcon
|
||||
} from "@heroicons/react/solid";
|
||||
|
||||
import APIClient from "../api/APIClient";
|
||||
import { APIClient } from "../api/APIClient";
|
||||
import { EmptyListState } from "../components/emptystates";
|
||||
import { classNames, simplifyDate } from "../utils";
|
||||
|
||||
|
@ -222,7 +222,7 @@ function Table() {
|
|||
Filter: SelectColumnFilter, // new
|
||||
filter: 'includes',
|
||||
},
|
||||
], [])
|
||||
] as Column<Release>[], [])
|
||||
|
||||
const [{ queryPageIndex, queryPageSize, totalCount }, dispatch] =
|
||||
React.useReducer(reducer, initialState);
|
||||
|
@ -260,7 +260,7 @@ function Table() {
|
|||
// setGlobalFilter,
|
||||
} = useTable({
|
||||
columns,
|
||||
data: isSuccess ? data.data : [],
|
||||
data: data && isSuccess ? data.data : [],
|
||||
initialState: {
|
||||
pageIndex: queryPageIndex,
|
||||
pageSize: queryPageSize,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue