From 7e4ce1fb4c26d0036f95453222e1a6cae00df526 Mon Sep 17 00:00:00 2001 From: shams mosowi Date: Mon, 23 Sep 2019 10:09:08 +1000 Subject: [PATCH] cleanup prop types --- src/components/Fields/CheckBox.tsx | 2 +- src/components/Fields/Date.tsx | 2 +- src/components/Fields/Image.tsx | 6 ++---- src/components/Fields/Number.tsx | 2 +- src/components/Table/index.tsx | 6 ++++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/Fields/CheckBox.tsx b/src/components/Fields/CheckBox.tsx index a40919b8..7b68ee17 100644 --- a/src/components/Fields/CheckBox.tsx +++ b/src/components/Fields/CheckBox.tsx @@ -5,7 +5,7 @@ import { Checkbox } from "@material-ui/core"; // TODO: Create an interface for props interface Props { value: boolean | null; - row: any; + row: { ref: firebase.firestore.DocumentReference; id: string }; onSubmit: Function; } diff --git a/src/components/Fields/Date.tsx b/src/components/Fields/Date.tsx index b1eaf092..12d43a0a 100644 --- a/src/components/Fields/Date.tsx +++ b/src/components/Fields/Date.tsx @@ -13,7 +13,7 @@ import { // TODO: Create an interface for props interface Props { value: firebase.firestore.Timestamp | null; - row: any; + row: { ref: firebase.firestore.DocumentReference; id: string }; onSubmit: Function; fieldType: FieldType; } diff --git a/src/components/Fields/Image.tsx b/src/components/Fields/Image.tsx index 179244d7..3ed8ecfc 100644 --- a/src/components/Fields/Image.tsx +++ b/src/components/Fields/Image.tsx @@ -2,19 +2,17 @@ import React, { useCallback, useState } from "react"; import { useDropzone } from "react-dropzone"; import useUploader from "../../hooks/useFiretable/useUploader"; -import { FieldType } from '.'; +import { FieldType } from "."; // TODO: indicate state completion / error // TODO: Create an interface for props - interface Props { value: any; - row: any; + row: { ref: firebase.firestore.DocumentReference; id: string }; onSubmit: Function; fieldType: FieldType; } - const Image = (props: any) => { const { columnData, cellData, cellActions, rowData, rowIndex } = props; const [uploaderState, upload] = useUploader(); diff --git a/src/components/Fields/Number.tsx b/src/components/Fields/Number.tsx index 91090585..23051ebf 100644 --- a/src/components/Fields/Number.tsx +++ b/src/components/Fields/Number.tsx @@ -4,7 +4,7 @@ import { TextField } from "@material-ui/core"; // TODO: Create an interface for props const Number = (props: any) => { - const { value, cellActions } = props; + const { value } = props; return ( createStyles({ typography: { @@ -110,7 +111,7 @@ function Table(props: any) { fromRowData.ref.update(updated); }; const onCellSelected = (args: any) => { - handleCloseHeader(); + // handleCloseHeader(); console.log(args); }; const headerRenderer = (props: any) => { @@ -129,6 +130,7 @@ function Table(props: any) { onClick={handleClick(props)} aria-label="edit" > + {getFieldIcon(props.column.type)} {props.column.name}