aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/components/Inputs/Text.js
diff options
context:
space:
mode:
authorJacky Zhao <[email protected]>2021-03-06 17:57:24 -0800
committerGitHub <[email protected]>2021-03-06 17:57:24 -0800
commit5dd02b5c2acd7a4c408ce9ffa1d95e208d20bbc8 (patch)
tree5a09bea364331dd0f41510153924065b815b702e /frontend/src/components/Inputs/Text.js
parentfix(typo): public api docs endpoint (diff)
parentfix password modal (diff)
downloadctrl-v-5dd02b5c2acd7a4c408ce9ffa1d95e208d20bbc8.tar.xz
ctrl-v-5dd02b5c2acd7a4c408ce9ffa1d95e208d20bbc8.zip
Merge pull request #70 from jackyzha0/visual-overhaul
Diffstat (limited to 'frontend/src/components/Inputs/Text.js')
-rw-r--r--frontend/src/components/Inputs/Text.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/frontend/src/components/Inputs/Text.js b/frontend/src/components/Inputs/Text.js
new file mode 100644
index 0000000..600e653
--- /dev/null
+++ b/frontend/src/components/Inputs/Text.js
@@ -0,0 +1,25 @@
+import CharLimit from "../decorators/CharLimit";
+import React from "react";
+import {Labelled} from "../decorators/Labelled";
+import {Input} from "../Common/Input";
+
+export const Text = React.forwardRef(({label, id, readOnly, onChange, value, maxLength, autoFocus}, ref) => {
+ return (
+ <Labelled label={label} value={value}>
+ <Input
+ ref={ref}
+ name={label}
+ readOnly={readOnly}
+ placeholder="Title"
+ id={id}
+ type="text"
+ autoFocus={autoFocus}
+ autoComplete="off"
+ onChange={onChange}
+ value={value} />
+ <CharLimit
+ content={value}
+ maxLength={maxLength} />
+ </Labelled>
+ );
+}) \ No newline at end of file