Skip to content

Commit

Permalink
Refactor component types and import statements in multiple files
Browse files Browse the repository at this point in the history
  • Loading branch information
simlarsen committed Apr 21, 2024
1 parent 308fe26 commit d04aa43
Show file tree
Hide file tree
Showing 15 changed files with 266 additions and 296 deletions.
4 changes: 3 additions & 1 deletion CommonUI/src/Components/Detail/Detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export interface ComponentProps<T extends GenericObject> {
showDetailsInNumberOfColumns?: number | undefined;
}

type DetailFunction = <T extends Object>(props: ComponentProps<T>) => ReactElement;
type DetailFunction = <T extends GenericObject>(
props: ComponentProps<T>
) => ReactElement;

const Detail: DetailFunction = <T extends GenericObject>(
props: ComponentProps<T>
Expand Down
3 changes: 2 additions & 1 deletion CommonUI/src/Components/Detail/Field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import AlignItem from '../../Types/AlignItem';
import FieldType from '../Types/FieldType';
import { DropdownOption } from '../Dropdown/Dropdown';
import { Size } from './FieldLabel';
import { JSONObject } from 'Common/Types/JSON';

export interface DetailSideLink {
text: string;
Expand All @@ -25,7 +26,7 @@ export interface FieldBase<T> {
getElement?:
| ((
item: T,
onBeforeFetchData?: T,
onBeforeFetchData?: JSONObject | undefined,
fetchItems?: VoidFunction
) => ReactElement)
| undefined;
Expand Down
4 changes: 3 additions & 1 deletion CommonUI/src/Components/List/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ export interface ComponentProps<T extends GenericObject> {
onFilterRefreshClick?: undefined | (() => void);
}

type ListFunction = <T extends Object>(props: ComponentProps<T>) => ReactElement;
type ListFunction = <T extends GenericObject>(
props: ComponentProps<T>
) => ReactElement;

const List: ListFunction = <T extends GenericObject>(
props: ComponentProps<T>
Expand Down
4 changes: 3 additions & 1 deletion CommonUI/src/Components/List/ListBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ export interface ComponentProps<T extends GenericObject> {
listDetailOptions?: undefined | ListDetailProps;
}

type ListBodyFunction = <T extends Object>(props: ComponentProps<T>) => ReactElement;
type ListBodyFunction = <T extends GenericObject>(
props: ComponentProps<T>
) => ReactElement;

const ListBody: ListBodyFunction = <T extends GenericObject>(
props: ComponentProps<T>
Expand Down
Loading

0 comments on commit d04aa43

Please sign in to comment.