From e615ad0282fa02ce7e81a847b43dd3146f69b769 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sun, 14 Mar 2021 06:40:09 +0300 Subject: fix: match keys everywhere --- src/components/Header.tsx | 2 +- src/components/ListTable.tsx | 5 +++-- src/containers/Page.tsx | 2 +- src/hooks/useAPIClient.ts | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/Header.tsx b/src/components/Header.tsx index bc77bf8..284d3d8 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -12,7 +12,7 @@ const Header: React.FC = ({ navigation }) => { return (
{navigation.map(({ name, route }) => ( - {name} + {name} ))}
); diff --git a/src/components/ListTable.tsx b/src/components/ListTable.tsx index 85b86aa..5c1333a 100644 --- a/src/components/ListTable.tsx +++ b/src/components/ListTable.tsx @@ -18,16 +18,17 @@ const ListTable: React.FC = ({ items = [], fields, handleRowClick = () => - {fields.map(field => )} + {fields.map(field => )} {items.map((item, index) => ( handleRowClick(index)} > - {fields.map(field => )} + {fields.map(field => )} ))} diff --git a/src/containers/Page.tsx b/src/containers/Page.tsx index a7c0964..c05ef4b 100644 --- a/src/containers/Page.tsx +++ b/src/containers/Page.tsx @@ -16,7 +16,7 @@ const Page: React.FC = ({ title, actions, children }) => (
{title}
- {actions?.map(action => ())} + {actions?.map(action => ())}
{children} diff --git a/src/hooks/useAPIClient.ts b/src/hooks/useAPIClient.ts index b36cfec..f2f2782 100644 --- a/src/hooks/useAPIClient.ts +++ b/src/hooks/useAPIClient.ts @@ -23,7 +23,7 @@ export const useProducts = (options = {}): Response => { export const useProduct = (_id: string): Response => { const { data: preloadedProducts } = useProducts({ revalidateOnMount: false }); - const result = useSWR(`/products/${_id}`, fetcher); + const result = useSWR(_id && `/products/${_id}`, fetcher); if (!result.data && result.isValidating) { // If we are waiting for the first result, check if we can maybe // get the data from already cached list for the time-being -- cgit v1.2.3
{field.label}{field.label}
{item[field.key]}{item[field.key]}