aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp/src/app/common/FileInput.tsx
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-09-01 02:32:06 +0800
committercrupest <crupest@outlook.com>2020-09-01 02:32:06 +0800
commitaa89b6cce7701a57b0c377d938788b4c940013d6 (patch)
treeae95cb16698439ac825eb1d692ce14125b625ecb /Timeline/ClientApp/src/app/common/FileInput.tsx
parentc3e95a6cd7322c644159eed6350a20dfd1a002ff (diff)
downloadtimeline-aa89b6cce7701a57b0c377d938788b4c940013d6.tar.gz
timeline-aa89b6cce7701a57b0c377d938788b4c940013d6.tar.bz2
timeline-aa89b6cce7701a57b0c377d938788b4c940013d6.zip
...
Diffstat (limited to 'Timeline/ClientApp/src/app/common/FileInput.tsx')
-rw-r--r--Timeline/ClientApp/src/app/common/FileInput.tsx41
1 files changed, 0 insertions, 41 deletions
diff --git a/Timeline/ClientApp/src/app/common/FileInput.tsx b/Timeline/ClientApp/src/app/common/FileInput.tsx
deleted file mode 100644
index 3d1bc2b3..00000000
--- a/Timeline/ClientApp/src/app/common/FileInput.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import React from "react";
-import clsx from "clsx";
-
-import { ExcludeKey } from "../utilities/type";
-
-export interface FileInputProps
- extends ExcludeKey<
- React.InputHTMLAttributes<HTMLInputElement>,
- "type" | "id"
- > {
- inputId?: string;
- labelText: string;
- color?: string;
- className?: string;
-}
-
-const FileInput: React.FC<FileInputProps> = (props) => {
- const { inputId, labelText, color, className, ...otherProps } = props;
-
- const realInputId = React.useMemo<string>(() => {
- if (inputId != null) return inputId;
- return (
- "file-input-" +
- (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1)
- );
- }, [inputId]);
-
- return (
- <>
- <input className="d-none" type="file" id={realInputId} {...otherProps} />
- <label
- htmlFor={realInputId}
- className={clsx("btn", "btn-" + (color ?? "primary"), className)}
- >
- {labelText}
- </label>
- </>
- );
-};
-
-export default FileInput;