diff --git a/src/components/Buttons/ButtonConfirmation.tsx b/src/components/Buttons/ButtonConfirmation.tsx index 1283798a18..b6ce6f0a85 100644 --- a/src/components/Buttons/ButtonConfirmation.tsx +++ b/src/components/Buttons/ButtonConfirmation.tsx @@ -52,11 +52,12 @@ export default function ButtonConfirmation(props: ButtonConfirmationProps) { diff --git a/src/components/Buttons/DeleteDialog.tsx b/src/components/Buttons/DeleteDialog.tsx index 7c3b3abd6e..0332599aec 100644 --- a/src/components/Buttons/DeleteDialog.tsx +++ b/src/components/Buttons/DeleteDialog.tsx @@ -6,7 +6,6 @@ import { DialogContentText, DialogTitle, } from "@material-ui/core"; -import { ButtonProps } from "@material-ui/core/Button"; import React from "react"; import { Translate } from "react-localize-redux"; @@ -20,7 +19,7 @@ interface DeleteDialogProps { /** * Dialog to confirm deletion */ -export default function DeleteDialog(props: ButtonProps & DeleteDialogProps) { +export default function DeleteDialog(props: DeleteDialogProps) { return ( diff --git a/src/components/Buttons/FileInputButton.tsx b/src/components/Buttons/FileInputButton.tsx index 8c712fce5d..7fd8c90a19 100644 --- a/src/components/Buttons/FileInputButton.tsx +++ b/src/components/Buttons/FileInputButton.tsx @@ -5,11 +5,13 @@ import { ButtonProps } from "@material-ui/core/Button"; export interface BrowseProps { updateFile: (file: File) => void; accept?: string; + children?: React.ReactNode; + buttonProps?: ButtonProps; } // This button links to a set of functions -export default function FileInputButton(props: BrowseProps & ButtonProps) { - function updateFile(files: FileList) { +export default function FileInputButton(props: BrowseProps) { + function updateFirstFile(files: FileList) { const file = files[0]; if (file) { props.updateFile(file); @@ -24,13 +26,13 @@ export default function FileInputButton(props: BrowseProps & ButtonProps) { type="file" name="name" accept={props.accept} - onChange={(e) => updateFile(e.target.files as FileList)} + onChange={(e) => updateFirstFile(e.target.files as FileList)} style={{ display: "none" }} /> {/* ... and this button is tied to it with the htmlFor property */} diff --git a/src/components/Buttons/LoadingButton.tsx b/src/components/Buttons/LoadingButton.tsx index 7a86d650da..f7ce5b7a3f 100644 --- a/src/components/Buttons/LoadingButton.tsx +++ b/src/components/Buttons/LoadingButton.tsx @@ -1,18 +1,21 @@ -import React from "react"; import { Button, CircularProgress } from "@material-ui/core"; -import { buttonSuccess } from "../../types/theme"; import { ButtonProps } from "@material-ui/core/Button"; +import React from "react"; + +import { buttonSuccess } from "../../types/theme"; -interface Props { +interface LoadingProps { loading: boolean; + children?: React.ReactNode; + buttonProps?: ButtonProps; } /** * A button that shows a spinning wheel when loading=true */ -export default function LoadingButton(props: Props & ButtonProps) { +export default function LoadingButton(props: LoadingProps) { return ( -