diff options
author | eug-vs <eug-vs@keemail.me> | 2021-03-26 00:44:51 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2021-03-26 00:44:51 +0300 |
commit | f1cdf02e9c0dca3354f4eebd38edd2ba12075893 (patch) | |
tree | c164c722d879869024a1dcd07fec225eb5f5bf47 /src/containers/Service | |
parent | 062f10a25d43b875d187cf582b2ecf96d075ec26 (diff) | |
download | commercel-ui-f1cdf02e9c0dca3354f4eebd38edd2ba12075893.tar.gz |
fix: improve typings
Diffstat (limited to 'src/containers/Service')
-rw-r--r-- | src/containers/Service/ServiceContext.tsx | 13 | ||||
-rw-r--r-- | src/containers/Service/ServiceItem.tsx | 4 |
2 files changed, 11 insertions, 6 deletions
diff --git a/src/containers/Service/ServiceContext.tsx b/src/containers/Service/ServiceContext.tsx index 75ac0fb..0cccc93 100644 --- a/src/containers/Service/ServiceContext.tsx +++ b/src/containers/Service/ServiceContext.tsx @@ -1,6 +1,11 @@ import React from 'react'; import { FormikProps } from 'formik'; -import { Action } from '../Page'; +import { Props as ButtonProps } from '../../components/Button'; +import { Field } from '../../components/ListTable'; + +export interface Action extends ButtonProps { + name: string; +} export interface PanelProps { item: any; @@ -10,9 +15,9 @@ export interface PanelProps { export interface ServiceParams { route: string; name: string; - nameSingular: string; - tableFields: any[]; - default: Record<string, any>; + nameSingular?: string; + tableFields: Field[]; + default?: Record<string, any>; routes?: Record<string, React.FC>; actions?: Action[]; rowLink?: (item: any) => string; diff --git a/src/containers/Service/ServiceItem.tsx b/src/containers/Service/ServiceItem.tsx index f833227..0e24895 100644 --- a/src/containers/Service/ServiceItem.tsx +++ b/src/containers/Service/ServiceItem.tsx @@ -2,11 +2,11 @@ import React, { useContext } from 'react'; import { useParams, useHistory } from 'react-router-dom'; import { Formik } from 'formik'; import _ from 'lodash'; -import Page, { Action } from '../Page'; +import Page from '../Page'; import hooks from '../../hooks/useAPIClient'; import useQuery from '../../hooks/useQuery'; import { post, patch, del } from '../../requests'; -import ServiceContext from './ServiceContext'; +import ServiceContext, { Action } from './ServiceContext'; interface Params { id: string; |