diff --git a/src/files-ui/components/dropzone/components/DropzoneActionButtons/DropzoneActionButtons.tsx b/src/files-ui/components/dropzone/components/DropzoneActionButtons/DropzoneActionButtons.tsx index f9fbe0f7891443ca751f9f5ae897acb6290a340a..4612283596fb7c251e19b46cd61778bed288fbe7 100644 --- a/src/files-ui/components/dropzone/components/DropzoneActionButtons/DropzoneActionButtons.tsx +++ b/src/files-ui/components/dropzone/components/DropzoneActionButtons/DropzoneActionButtons.tsx @@ -1,8 +1,8 @@ import * as React from "react"; -interface DropzoneActionButtonsProps {} -const DropzoneActionButtons: React.FC<DropzoneActionButtonsProps> = ( - props: DropzoneActionButtonsProps +interface ActionButtonsProps {} +const ActionButtons: React.FC<ActionButtonsProps> = ( + props: ActionButtonsProps ) => { - return <div>DropzoneActionButtons</div>; + return <div>ActionButtons</div>; }; -export default DropzoneActionButtons; +export default ActionButtons; diff --git a/src/files-ui/components/dropzone/components/DropzoneButtons/DropzoneButtons.tsx b/src/files-ui/components/dropzone/components/DropzoneButtons/DropzoneButtons.tsx index 9215d1d78cc4d809e1eec02b08138a313a4e8915..7e1dae8dc23149d63857e5f39b76e45a8d55b816 100644 --- a/src/files-ui/components/dropzone/components/DropzoneButtons/DropzoneButtons.tsx +++ b/src/files-ui/components/dropzone/components/DropzoneButtons/DropzoneButtons.tsx @@ -2,7 +2,7 @@ import * as React from "react"; import { addClassName, Localization } from "../../../../core"; import { MaterialButton } from "../../../material-button"; import { - DropzoneActionButton, + ActionButtonItem, DropzoneActions, } from "../dropzone/DropzoneProps"; import "./DropzoneButtons.scss"; @@ -36,7 +36,7 @@ const DropzoneButtons: React.FC<DropzoneButtonsProps> = ( disabled, } = props; - const actionButtonsList: DropzoneActionButton[] = [ + const actionButtonsList: ActionButtonItem[] = [ cleanButton ? { ...cleanButton, label: "Clean", onClick: onClean } : undefined, @@ -50,8 +50,8 @@ const DropzoneButtons: React.FC<DropzoneButtonsProps> = ( ? { ...abortButton, label: "Abort", onClick: onAbort } : undefined, ].filter( - (ab: DropzoneActionButton | undefined) => ab !== undefined - ) as DropzoneActionButton[]; + (ab: ActionButtonItem | undefined) => ab !== undefined + ) as ActionButtonItem[]; const tailClassName:string = `${top ? " top" : " bottom"}`; const finalClassName = addClassName( @@ -62,7 +62,7 @@ const DropzoneButtons: React.FC<DropzoneButtonsProps> = ( return ( <div className={finalClassName} style={containerStyle}> {actionButtonsList.map( - (actionButtonProps: DropzoneActionButton, index: number) => { + (actionButtonProps: ActionButtonItem, index: number) => { const { children, label, resetStyles, className, style, onClick } = actionButtonProps; return ( diff --git a/src/files-ui/components/dropzone/components/dropzone/Dropzone.tsx b/src/files-ui/components/dropzone/components/dropzone/Dropzone.tsx index d05306c9d768232831f68d54766d7ed79d7199a0..e0d4e2d7527be90925dc96bb3d2021d52859a4e3 100644 --- a/src/files-ui/components/dropzone/components/dropzone/Dropzone.tsx +++ b/src/files-ui/components/dropzone/components/dropzone/Dropzone.tsx @@ -35,7 +35,7 @@ import { ActionButtons, defaultDrozoneProps, // DEFAULT_BORDER_RADIUS, - //DropzoneActionButton, + //ActionButton, //DropzoneActions, DropzoneProps, FooterConfig, diff --git a/src/files-ui/components/dropzone/components/dropzone/DropzoneProps.ts b/src/files-ui/components/dropzone/components/dropzone/DropzoneProps.ts index b2d2e5c5b4ab98b5dea823930d5826e6c60b3981..5bf2d8311098196dcf8e427dda6611dcb88f2c81 100644 --- a/src/files-ui/components/dropzone/components/dropzone/DropzoneProps.ts +++ b/src/files-ui/components/dropzone/components/dropzone/DropzoneProps.ts @@ -252,7 +252,7 @@ export type FooterConfig = { } -export type DropzoneActionButton = { +export type ActionButtonItem = { children?: JSX.Element; label?: string; style?: React.CSSProperties; @@ -266,10 +266,10 @@ export interface DropzoneActions { position?: "top" | "bottom"; style?: React.CSSProperties; className?: string; - uploadButton?: DropzoneActionButton; - abortButton?: DropzoneActionButton; - deleteButton?: DropzoneActionButton; - cleanButton?: DropzoneActionButton; + uploadButton?: ActionButtonItem; + abortButton?: ActionButtonItem; + deleteButton?: ActionButtonItem; + cleanButton?: ActionButtonItem; } export type ActionButtons = { [P in keyof DropzoneActions]: DropzoneActions[P] diff --git a/src/files-ui/components/dropzone/makeListOfActionButtons.ts b/src/files-ui/components/dropzone/makeListOfActionButtons.ts index bb53906aab9eee7abdb2efd3a8318c101abe2d0a..b26efc228d6ae5acb97ad47dca48de615a7ce03f 100644 --- a/src/files-ui/components/dropzone/makeListOfActionButtons.ts +++ b/src/files-ui/components/dropzone/makeListOfActionButtons.ts @@ -1,4 +1,4 @@ -import { DropzoneActionButton } from "./components/dropzone/DropzoneProps"; +import { ActionButtonItem } from "./components/dropzone/DropzoneProps"; /** * @@ -8,14 +8,14 @@ import { DropzoneActionButton } from "./components/dropzone/DropzoneProps"; * @param other array of other custom action buttons props * @returns */ -export const makeListOfActionButtons = ( - uploadButton: DropzoneActionButton | undefined, - abortButton: DropzoneActionButton | undefined, - deleteButton: DropzoneActionButton | undefined, - cleanButton: DropzoneActionButton | undefined -): [DropzoneActionButton[], DropzoneActionButton[]] => { - let listOfTopButtons: DropzoneActionButton[] = []; - let listOfBottomButtons: DropzoneActionButton[] = []; +export const makeListOfActionButtonItems = ( + uploadButton: ActionButtonItem | undefined, + abortButton: ActionButtonItem | undefined, + deleteButton: ActionButtonItem | undefined, + cleanButton: ActionButtonItem | undefined +): [ActionButtonItem[], ActionButtonItem[]] => { + let listOfTopButtons: ActionButtonItem[] = []; + let listOfBottomButtons: ActionButtonItem[] = []; /* if (uploadButton) { uploadButton.position === "top" ? listOfTopButtons.push(uploadButton)