Skip to content

Commit a58ac3c

Browse files
committed
[REF]: Change type name from ActionButton to ActionButtonItem and from DropzoneActions to ActionButtons
1 parent 92e78da commit a58ac3c

File tree

5 files changed

+25
-25
lines changed

5 files changed

+25
-25
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as React from "react";
2-
interface DropzoneActionButtonsProps {}
3-
const DropzoneActionButtons: React.FC<DropzoneActionButtonsProps> = (
4-
props: DropzoneActionButtonsProps
2+
interface ActionButtonsProps {}
3+
const ActionButtons: React.FC<ActionButtonsProps> = (
4+
props: ActionButtonsProps
55
) => {
6-
return <div>DropzoneActionButtons</div>;
6+
return <div>ActionButtons</div>;
77
};
8-
export default DropzoneActionButtons;
8+
export default ActionButtons;

src/files-ui/components/dropzone/components/DropzoneButtons/DropzoneButtons.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from "react";
22
import { addClassName, Localization } from "../../../../core";
33
import { MaterialButton } from "../../../material-button";
44
import {
5-
DropzoneActionButton,
5+
ActionButtonItem,
66
DropzoneActions,
77
} from "../dropzone/DropzoneProps";
88
import "./DropzoneButtons.scss";
@@ -36,7 +36,7 @@ const DropzoneButtons: React.FC<DropzoneButtonsProps> = (
3636
disabled,
3737
} = props;
3838

39-
const actionButtonsList: DropzoneActionButton[] = [
39+
const actionButtonsList: ActionButtonItem[] = [
4040
cleanButton
4141
? { ...cleanButton, label: "Clean", onClick: onClean }
4242
: undefined,
@@ -50,8 +50,8 @@ const DropzoneButtons: React.FC<DropzoneButtonsProps> = (
5050
? { ...abortButton, label: "Abort", onClick: onAbort }
5151
: undefined,
5252
].filter(
53-
(ab: DropzoneActionButton | undefined) => ab !== undefined
54-
) as DropzoneActionButton[];
53+
(ab: ActionButtonItem | undefined) => ab !== undefined
54+
) as ActionButtonItem[];
5555

5656
const tailClassName:string = `${top ? " top" : " bottom"}`;
5757
const finalClassName = addClassName(
@@ -62,7 +62,7 @@ const DropzoneButtons: React.FC<DropzoneButtonsProps> = (
6262
return (
6363
<div className={finalClassName} style={containerStyle}>
6464
{actionButtonsList.map(
65-
(actionButtonProps: DropzoneActionButton, index: number) => {
65+
(actionButtonProps: ActionButtonItem, index: number) => {
6666
const { children, label, resetStyles, className, style, onClick } =
6767
actionButtonProps;
6868
return (

src/files-ui/components/dropzone/components/dropzone/Dropzone.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import {
3535
ActionButtons,
3636
defaultDrozoneProps,
3737
// DEFAULT_BORDER_RADIUS,
38-
//DropzoneActionButton,
38+
//ActionButton,
3939
//DropzoneActions,
4040
DropzoneProps,
4141
FooterConfig,

src/files-ui/components/dropzone/components/dropzone/DropzoneProps.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ export type FooterConfig = {
252252
}
253253

254254

255-
export type DropzoneActionButton = {
255+
export type ActionButtonItem = {
256256
children?: JSX.Element;
257257
label?: string;
258258
style?: React.CSSProperties;
@@ -266,10 +266,10 @@ export interface DropzoneActions {
266266
position?: "top" | "bottom";
267267
style?: React.CSSProperties;
268268
className?: string;
269-
uploadButton?: DropzoneActionButton;
270-
abortButton?: DropzoneActionButton;
271-
deleteButton?: DropzoneActionButton;
272-
cleanButton?: DropzoneActionButton;
269+
uploadButton?: ActionButtonItem;
270+
abortButton?: ActionButtonItem;
271+
deleteButton?: ActionButtonItem;
272+
cleanButton?: ActionButtonItem;
273273
}
274274
export type ActionButtons = {
275275
[P in keyof DropzoneActions]: DropzoneActions[P]

src/files-ui/components/dropzone/makeListOfActionButtons.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DropzoneActionButton } from "./components/dropzone/DropzoneProps";
1+
import { ActionButtonItem } from "./components/dropzone/DropzoneProps";
22

33
/**
44
*
@@ -8,14 +8,14 @@ import { DropzoneActionButton } from "./components/dropzone/DropzoneProps";
88
* @param other array of other custom action buttons props
99
* @returns
1010
*/
11-
export const makeListOfActionButtons = (
12-
uploadButton: DropzoneActionButton | undefined,
13-
abortButton: DropzoneActionButton | undefined,
14-
deleteButton: DropzoneActionButton | undefined,
15-
cleanButton: DropzoneActionButton | undefined
16-
): [DropzoneActionButton[], DropzoneActionButton[]] => {
17-
let listOfTopButtons: DropzoneActionButton[] = [];
18-
let listOfBottomButtons: DropzoneActionButton[] = [];
11+
export const makeListOfActionButtonItems = (
12+
uploadButton: ActionButtonItem | undefined,
13+
abortButton: ActionButtonItem | undefined,
14+
deleteButton: ActionButtonItem | undefined,
15+
cleanButton: ActionButtonItem | undefined
16+
): [ActionButtonItem[], ActionButtonItem[]] => {
17+
let listOfTopButtons: ActionButtonItem[] = [];
18+
let listOfBottomButtons: ActionButtonItem[] = [];
1919
/* if (uploadButton) {
2020
uploadButton.position === "top"
2121
? listOfTopButtons.push(uploadButton)

0 commit comments

Comments
 (0)