mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-29 00:16:39 +01:00
added some prop interfaces
This commit is contained in:
@@ -3,12 +3,18 @@ import React from "react";
|
||||
import { Checkbox } from "@material-ui/core";
|
||||
|
||||
// TODO: Create an interface for props
|
||||
const CheckBox = (props: any) => {
|
||||
interface Props {
|
||||
value: boolean | null;
|
||||
row: any;
|
||||
onSubmit: Function;
|
||||
}
|
||||
|
||||
const CheckBox = (props: Props) => {
|
||||
const { value, row, onSubmit } = props;
|
||||
return (
|
||||
<Checkbox
|
||||
name={`checkBox-controlled-${row.id}`}
|
||||
checked={value}
|
||||
checked={!!value}
|
||||
onChange={e => {
|
||||
onSubmit(row.ref, !value);
|
||||
}}
|
||||
|
||||
@@ -11,7 +11,14 @@ import {
|
||||
} from "@material-ui/pickers";
|
||||
|
||||
// TODO: Create an interface for props
|
||||
const Date = (props: any) => {
|
||||
interface Props {
|
||||
value: firebase.firestore.Timestamp | null;
|
||||
row: any;
|
||||
onSubmit: Function;
|
||||
fieldType: FieldType;
|
||||
}
|
||||
|
||||
const Date = (props: Props) => {
|
||||
const { value, row, onSubmit, fieldType } = props;
|
||||
function handleDateChange(date: Date | null) {
|
||||
if (date) {
|
||||
|
||||
@@ -2,8 +2,19 @@ import React, { useCallback, useState } from "react";
|
||||
import { useDropzone } from "react-dropzone";
|
||||
import useUploader from "../../hooks/useFiretable/useUploader";
|
||||
|
||||
// TODO: indecate state completion / error
|
||||
import { FieldType } from '.';
|
||||
// TODO: indicate state completion / error
|
||||
// TODO: Create an interface for props
|
||||
|
||||
|
||||
interface Props {
|
||||
value: any;
|
||||
row: any;
|
||||
onSubmit: Function;
|
||||
fieldType: FieldType;
|
||||
}
|
||||
|
||||
|
||||
const Image = (props: any) => {
|
||||
const { columnData, cellData, cellActions, rowData, rowIndex } = props;
|
||||
const [uploaderState, upload] = useUploader();
|
||||
|
||||
@@ -2,6 +2,12 @@ import React from "react";
|
||||
import ExpandIcon from "@material-ui/icons/AspectRatio";
|
||||
import IconButton from "@material-ui/core/IconButton";
|
||||
|
||||
interface Props {
|
||||
value: firebase.firestore.Timestamp | null;
|
||||
row: any;
|
||||
onSubmit: Function;
|
||||
}
|
||||
|
||||
const UrlLink = (props: any) => {
|
||||
const { value, cellActions } = props;
|
||||
return value ? (
|
||||
|
||||
@@ -2,9 +2,12 @@ import React from "react";
|
||||
import EditIcon from "@material-ui/icons/Edit";
|
||||
// TODO: regex validating url
|
||||
// ^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$
|
||||
interface Props {
|
||||
value: string | null;
|
||||
}
|
||||
|
||||
const UrlLink = (props: any) => {
|
||||
const { value, cellActions } = props;
|
||||
const UrlLink = (props: Props) => {
|
||||
const { value } = props;
|
||||
return value ? (
|
||||
<>
|
||||
<EditIcon />
|
||||
|
||||
Reference in New Issue
Block a user