aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src/components/BugTitleForm/BugTitleInput.tsx
diff options
context:
space:
mode:
authorSascha <GlancingMind@outlook.com>2021-03-03 21:09:44 +0100
committerSascha <GlancingMind@outlook.com>2021-03-04 20:54:04 +0100
commite040fc807e840fcde03a588884d195c44db254a2 (patch)
tree8352c286af58259205777213c2110214872445b6 /webui/src/components/BugTitleForm/BugTitleInput.tsx
parent50484fb97efd62aceafdbb78ed575e94ff7bb1fd (diff)
downloadgit-bug-e040fc807e840fcde03a588884d195c44db254a2.tar.gz
Implement title inputfield as custom component
Diffstat (limited to 'webui/src/components/BugTitleForm/BugTitleInput.tsx')
-rw-r--r--webui/src/components/BugTitleForm/BugTitleInput.tsx40
1 files changed, 40 insertions, 0 deletions
diff --git a/webui/src/components/BugTitleForm/BugTitleInput.tsx b/webui/src/components/BugTitleForm/BugTitleInput.tsx
new file mode 100644
index 00000000..d2b060a2
--- /dev/null
+++ b/webui/src/components/BugTitleForm/BugTitleInput.tsx
@@ -0,0 +1,40 @@
+import { createStyles, fade, withStyles, TextField } from '@material-ui/core';
+import { Theme } from '@material-ui/core/styles';
+
+const BugTitleInput = withStyles((theme: Theme) =>
+ createStyles({
+ root: {
+ '& .MuiInputLabel-outlined': {
+ color: theme.palette.text.primary,
+ },
+ '& input:valid + fieldset': {
+ color: theme.palette.text.primary,
+ borderColor: theme.palette.divider,
+ borderWidth: 2,
+ },
+ '& input:valid:hover + fieldset': {
+ color: theme.palette.text.primary,
+ borderColor: fade(theme.palette.divider, 0.3),
+ borderWidth: 2,
+ },
+ '& input:valid:focus + fieldset': {
+ color: theme.palette.text.primary,
+ borderColor: theme.palette.divider,
+ },
+ '& input:invalid + fieldset': {
+ borderColor: theme.palette.error.main,
+ borderWidth: 2,
+ },
+ '& input:invalid:hover + fieldset': {
+ borderColor: theme.palette.error.main,
+ borderWidth: 2,
+ },
+ '& input:invalid:focus + fieldset': {
+ borderColor: theme.palette.error.main,
+ borderWidth: 2,
+ },
+ },
+ })
+)(TextField);
+
+export default BugTitleInput;