diff options
author | crupest <crupest@outlook.com> | 2020-09-03 18:10:02 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-09-03 18:10:02 +0800 |
commit | ac40d9c18e2ac7b4995dac38d5da04a3ea7f1559 (patch) | |
tree | ed843d6075b8c7667f1a402dfddf3f892fba3ffa /Timeline/ClientApp/src/app/views/common/FileInput.tsx | |
parent | b027f7d2793999159b362041b2f697df74e4b1b9 (diff) | |
download | timeline-ac40d9c18e2ac7b4995dac38d5da04a3ea7f1559.tar.gz timeline-ac40d9c18e2ac7b4995dac38d5da04a3ea7f1559.tar.bz2 timeline-ac40d9c18e2ac7b4995dac38d5da04a3ea7f1559.zip |
Migrate to react-bootstrap.
Diffstat (limited to 'Timeline/ClientApp/src/app/views/common/FileInput.tsx')
-rw-r--r-- | Timeline/ClientApp/src/app/views/common/FileInput.tsx | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/Timeline/ClientApp/src/app/views/common/FileInput.tsx b/Timeline/ClientApp/src/app/views/common/FileInput.tsx deleted file mode 100644 index 7b053d5c..00000000 --- a/Timeline/ClientApp/src/app/views/common/FileInput.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import React from "react"; -import clsx from "clsx"; - -export interface FileInputProps - extends Omit<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; |