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
17
Merged
Defendi Alberto
requested to merge
api-login
into
dev
3 years ago
Overview
0
Commits
5
Pipelines
1
Changes
17
Expand
0
0
Merge request reports
Compare
dev
version 1
1bab70b5
3 years ago
dev (base)
and
version 1
latest version
1bab70b5
5 commits,
3 years ago
version 1
1bab70b5
24 commits,
3 years ago
17 files
+
509
−
86
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
17
Search (e.g. *.vue) (Ctrl+P)
src/components/AuthUser/SignInForm/InputField.tsx
0 → 100644
+
46
−
0
Options
import
React
,
{
FC
}
from
'
react
'
;
import
{
TextField
}
from
'
@material-ui/core
'
;
import
{
Control
,
Controller
,
FieldValues
}
from
'
react-hook-form
'
;
type
Props
=
{
/**
* Name of the elemement. ex. email, password
*/
name
:
string
;
label
:
string
;
error
:
boolean
;
errorMessage
:
string
;
/**
* react-hook-form control
*/
control
:
Control
<
FieldValues
>
|
undefined
;
rules
:
Partial
<
unknown
>
;
};
export
const
InputField
:
FC
<
Props
>
=
(
props
:
Props
)
=>
{
const
{
name
,
label
,
error
,
errorMessage
,
control
,
rules
}
=
props
;
return
(
<
Controller
name
=
{
name
}
control
=
{
control
}
rules
=
{
rules
}
render
=
{
({
onChange
,
value
})
=>
(
<
TextField
variant
=
"outlined"
margin
=
"normal"
required
fullWidth
id
=
{
name
}
label
=
{
label
}
name
=
{
name
}
onChange
=
{
onChange
}
value
=
{
value
}
autoComplete
=
{
name
}
autoFocus
error
=
{
error
}
helperText
=
{
error
&&
errorMessage
}
/>
)
}
/>
);
};
Loading