Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dashboard
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
red-giant
dashboard
Merge requests
!19
Working email validation and hiding controller logic to InputField
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Working email validation and hiding controller logic to InputField
api-login
into
dev
Overview
0
Commits
5
Pipelines
1
Changes
7
Merged
Defendi Alberto
requested to merge
api-login
into
dev
3 years ago
Overview
0
Commits
5
Pipelines
1
Changes
7
Expand
0
0
Merge request reports
Compare
dev
version 1
1bab70b5
3 years ago
dev (base)
and
latest version
latest version
1bab70b5
5 commits,
3 years ago
version 1
1bab70b5
24 commits,
3 years ago
7 files
+
61
−
57
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
7
Search (e.g. *.vue) (Ctrl+P)
src/components/AuthUser/SignInForm/InputField.tsx
+
32
−
18
Options
import
React
,
{
FC
}
from
'
react
'
;
import
React
,
{
FC
}
from
'
react
'
;
import
{
TextField
}
from
'
@material-ui/core
'
;
import
{
TextField
}
from
'
@material-ui/core
'
;
import
{
Control
,
Controller
,
FieldValues
}
from
'
react-hook-form
'
;
type
Props
=
{
type
Props
=
{
id
:
string
;
/**
* Name of the elemement. ex. email, password
*/
name
:
string
;
label
:
string
;
label
:
string
;
error
:
boolean
;
error
:
boolean
;
errorMessage
:
string
;
errorMessage
:
string
;
value
:
string
;
/**
onChange
:
any
;
* react-hook-form control
*/
control
:
Control
<
FieldValues
>
|
undefined
;
rules
:
Partial
<
unknown
>
;
};
};
export
const
InputField
:
FC
<
Props
>
=
(
props
:
Props
)
=>
{
export
const
InputField
:
FC
<
Props
>
=
(
props
:
Props
)
=>
{
const
{
id
,
label
,
error
,
errorMessage
,
on
Change
,
value
}
=
props
;
const
{
name
,
label
,
error
,
errorMessage
,
c
on
trol
,
rules
}
=
props
;
return
(
return
(
<
TextField
<
Controller
variant
=
"outlined"
name
=
{
name
}
margin
=
"normal"
control
=
{
control
}
required
rules
=
{
rules
}
fullWidth
render
=
{
({
onChange
,
value
})
=>
(
id
=
{
id
}
<
TextField
label
=
{
label
}
variant
=
"outlined"
name
=
{
id
}
margin
=
"normal"
onChange
=
{
onChange
}
required
value
=
{
value
}
fullWidth
autoComplete
=
{
id
}
id
=
{
name
}
autoFocus
label
=
{
label
}
error
=
{
error
}
name
=
{
name
}
helperText
=
{
error
&&
errorMessage
}
onChange
=
{
onChange
}
value
=
{
value
}
autoComplete
=
{
name
}
autoFocus
error
=
{
error
}
helperText
=
{
error
&&
errorMessage
}
/>
)
}
/>
/>
);
);
};
};
Loading