Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
safetcut-app
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
atichat
safetcut-app
Commits
7451ff69
Commit
7451ff69
authored
Jul 22, 2019
by
Tonk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add hide/show password
parent
0fe96d16
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
17 deletions
+42
-17
components/InputField.js
+20
-9
constants/Styles.js
+12
-8
screens/Public/LoginScreen.js
+4
-0
screens/Public/RegisterScreen.js
+6
-0
No files found.
components/InputField.js
View file @
7451ff69
...
...
@@ -12,10 +12,12 @@ const InputField = ({
placeholder
,
errors
,
// this array prop is automatically passed down to this component from <Form />
isPass
,
passVisible
,
onPressEye
,
})
=>
{
return
(
<
View
>
<
View
>
<
View
style
=
{
theme
.
inputContainer
}
>
<
TextInput
value
=
{
value
&&
value
}
onChangeText
=
{
onChangeText
?
val
=>
onChangeText
(
val
)
:
null
}
...
...
@@ -23,16 +25,25 @@ const InputField = ({
placeholderTextColor
=
{
color
.
grey2
}
disabled
=
{
disabled
}
style
=
{
customStyle
?
customStyle
:
{}}
secureTextEntry
=
{
isPass
}
secureTextEntry
=
{
!
passVisible
}
/
>
{
errors
&&
errors
.
length
>
0
&&
errors
.
map
((
item
,
index
)
=>
item
.
field
===
name
&&
item
.
error
?
(
<
Icon
key
=
{
`
${
index
}
`
}
name
=
"close"
style
=
{
theme
.
inputErrIcon
}
/
>
)
:
null
<
View
style
=
{{
flexDirection
:
'row'
,
alignItems
:
'flex-end'
}}
>
{
isPass
&&
(
<
Icon
onPress
=
{
onPressEye
}
name
=
{
passVisible
?
'eye'
:
'eye-off'
}
style
=
{[
theme
.
inputPassVisible
]}
/
>
)}
{
errors
&&
errors
.
length
>
0
&&
errors
.
map
((
item
,
index
)
=>
item
.
field
===
name
&&
item
.
error
?
(
<
Icon
key
=
{
`
${
index
}
`
}
name
=
"close"
style
=
{
theme
.
inputErrIcon
}
/
>
)
:
null
)}
<
/View
>
<
/View
>
{
errors
&&
errors
.
length
>
0
&&
...
...
constants/Styles.js
View file @
7451ff69
...
...
@@ -26,10 +26,10 @@ export const theme = StyleSheet.create({
marginBottom
:
10
,
},
inputContainer
:
{
flex
:
1
,
borderBottomWidth
:
1
,
flexDirection
:
'row'
,
alignItems
:
'flex-end
'
,
justifyContent
:
'center'
,
justifyContent
:
'space-between
'
,
borderBottomColor
:
color
.
inputBorder
,
},
container
:
{
flex
:
1
,
...
...
@@ -49,9 +49,9 @@ export const theme = StyleSheet.create({
marginTop
:
25
,
paddingBottom
:
5
,
color
:
color
.
grey1
,
borderBottomWidth
:
1
,
//
borderBottomWidth: 1,
fontFamily
:
'Avenir-Roman'
,
borderBottomColor
:
color
.
inputBorder
,
//
borderBottomColor: color.inputBorder,
},
inputErrText
:
{
bottom
:
-
15
,
...
...
@@ -76,10 +76,14 @@ export const theme = StyleSheet.create({
alignItems
:
'center'
,
},
inputErrIcon
:
{
right
:
5
,
bottom
:
0
,
marginBottom
:
5
,
marginLeft
:
1
0
,
fontSize
:
20
,
color
:
color
.
red1
,
position
:
'absolute'
,
},
inputPassVisible
:
{
marginBottom
:
5
,
fontSize
:
20
,
color
:
'#d8d8d8'
,
},
});
screens/Public/LoginScreen.js
View file @
7451ff69
...
...
@@ -29,6 +29,8 @@ const styles = StyleSheet.create({
export
default
class
LoginScreen
extends
Component
{
state
=
{
isCheck
:
false
,
pass
:
''
,
passVisible
:
false
,
};
submitForm
()
{
...
...
@@ -90,6 +92,8 @@ export default class LoginScreen extends Component {
customStyle
=
{
theme
.
input
}
placeholder
=
"Password"
isPass
=
{
true
}
passVisible
=
{
this
.
state
.
passVisible
}
onPressEye
=
{()
=>
this
.
setState
({
passVisible
:
!
this
.
state
.
passVisible
})}
/
>
<
/Form
>
<
Row
style
=
{{
marginTop
:
30
}}
>
...
...
screens/Public/RegisterScreen.js
View file @
7451ff69
...
...
@@ -26,6 +26,8 @@ export default class RegisterScreen extends Component {
password
:
''
,
cfPassword
:
''
,
phoneNum
:
''
,
passVisible
:
false
,
cfPassVisible
:
false
,
};
submitForm
()
{
...
...
@@ -117,6 +119,8 @@ export default class RegisterScreen extends Component {
customStyle
=
{
theme
.
input
}
placeholder
=
"Password"
isPass
=
{
true
}
passVisible
=
{
this
.
state
.
passVisible
}
onPressEye
=
{()
=>
this
.
setState
({
passVisible
:
!
this
.
state
.
passVisible
})}
/
>
{
/* ---cf password--- */
}
<
Field
...
...
@@ -129,6 +133,8 @@ export default class RegisterScreen extends Component {
customStyle
=
{
theme
.
input
}
placeholder
=
"Confirm password"
isPass
=
{
true
}
passVisible
=
{
this
.
state
.
cfPassVisible
}
onPressEye
=
{()
=>
this
.
setState
({
cfPassVisible
:
!
this
.
state
.
cfPassVisible
})}
/
>
{
/* ---phone no--- */
}
<
Field
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment