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
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
10 deletions
+35
-10
components/InputField.js
+13
-2
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 = ({
...
@@ -12,10 +12,12 @@ const InputField = ({
placeholder
,
placeholder
,
errors
,
// this array prop is automatically passed down to this component from <Form />
errors
,
// this array prop is automatically passed down to this component from <Form />
isPass
,
isPass
,
passVisible
,
onPressEye
,
})
=>
{
})
=>
{
return
(
return
(
<
View
>
<
View
>
<
View
>
<
View
style
=
{
theme
.
inputContainer
}
>
<
TextInput
<
TextInput
value
=
{
value
&&
value
}
value
=
{
value
&&
value
}
onChangeText
=
{
onChangeText
?
val
=>
onChangeText
(
val
)
:
null
}
onChangeText
=
{
onChangeText
?
val
=>
onChangeText
(
val
)
:
null
}
...
@@ -23,8 +25,16 @@ const InputField = ({
...
@@ -23,8 +25,16 @@ const InputField = ({
placeholderTextColor
=
{
color
.
grey2
}
placeholderTextColor
=
{
color
.
grey2
}
disabled
=
{
disabled
}
disabled
=
{
disabled
}
style
=
{
customStyle
?
customStyle
:
{}}
style
=
{
customStyle
?
customStyle
:
{}}
secureTextEntry
=
{
isPass
}
secureTextEntry
=
{
!
passVisible
}
/
>
<
View
style
=
{{
flexDirection
:
'row'
,
alignItems
:
'flex-end'
}}
>
{
isPass
&&
(
<
Icon
onPress
=
{
onPressEye
}
name
=
{
passVisible
?
'eye'
:
'eye-off'
}
style
=
{[
theme
.
inputPassVisible
]}
/
>
/
>
)}
{
errors
&&
{
errors
&&
errors
.
length
>
0
&&
errors
.
length
>
0
&&
...
@@ -34,6 +44,7 @@ const InputField = ({
...
@@ -34,6 +44,7 @@ const InputField = ({
)
:
null
)
:
null
)}
)}
<
/View
>
<
/View
>
<
/View
>
{
errors
&&
{
errors
&&
errors
.
length
>
0
&&
errors
.
length
>
0
&&
errors
.
map
((
item
,
index
)
=>
errors
.
map
((
item
,
index
)
=>
...
...
constants/Styles.js
View file @
7451ff69
...
@@ -26,10 +26,10 @@ export const theme = StyleSheet.create({
...
@@ -26,10 +26,10 @@ export const theme = StyleSheet.create({
marginBottom
:
10
,
marginBottom
:
10
,
},
},
inputContainer
:
{
inputContainer
:
{
flex
:
1
,
borderBottomWidth
:
1
,
flexDirection
:
'row'
,
flexDirection
:
'row'
,
alignItems
:
'flex-end
'
,
justifyContent
:
'space-between
'
,
justifyContent
:
'center'
,
borderBottomColor
:
color
.
inputBorder
,
},
},
container
:
{
container
:
{
flex
:
1
,
flex
:
1
,
...
@@ -49,9 +49,9 @@ export const theme = StyleSheet.create({
...
@@ -49,9 +49,9 @@ export const theme = StyleSheet.create({
marginTop
:
25
,
marginTop
:
25
,
paddingBottom
:
5
,
paddingBottom
:
5
,
color
:
color
.
grey1
,
color
:
color
.
grey1
,
borderBottomWidth
:
1
,
//
borderBottomWidth: 1,
fontFamily
:
'Avenir-Roman'
,
fontFamily
:
'Avenir-Roman'
,
borderBottomColor
:
color
.
inputBorder
,
//
borderBottomColor: color.inputBorder,
},
},
inputErrText
:
{
inputErrText
:
{
bottom
:
-
15
,
bottom
:
-
15
,
...
@@ -76,10 +76,14 @@ export const theme = StyleSheet.create({
...
@@ -76,10 +76,14 @@ export const theme = StyleSheet.create({
alignItems
:
'center'
,
alignItems
:
'center'
,
},
},
inputErrIcon
:
{
inputErrIcon
:
{
right
:
5
,
marginBottom
:
5
,
bottom
:
0
,
marginLeft
:
1
0
,
fontSize
:
20
,
fontSize
:
20
,
color
:
color
.
red1
,
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({
...
@@ -29,6 +29,8 @@ const styles = StyleSheet.create({
export
default
class
LoginScreen
extends
Component
{
export
default
class
LoginScreen
extends
Component
{
state
=
{
state
=
{
isCheck
:
false
,
isCheck
:
false
,
pass
:
''
,
passVisible
:
false
,
};
};
submitForm
()
{
submitForm
()
{
...
@@ -90,6 +92,8 @@ export default class LoginScreen extends Component {
...
@@ -90,6 +92,8 @@ export default class LoginScreen extends Component {
customStyle
=
{
theme
.
input
}
customStyle
=
{
theme
.
input
}
placeholder
=
"Password"
placeholder
=
"Password"
isPass
=
{
true
}
isPass
=
{
true
}
passVisible
=
{
this
.
state
.
passVisible
}
onPressEye
=
{()
=>
this
.
setState
({
passVisible
:
!
this
.
state
.
passVisible
})}
/
>
/
>
<
/Form
>
<
/Form
>
<
Row
style
=
{{
marginTop
:
30
}}
>
<
Row
style
=
{{
marginTop
:
30
}}
>
...
...
screens/Public/RegisterScreen.js
View file @
7451ff69
...
@@ -26,6 +26,8 @@ export default class RegisterScreen extends Component {
...
@@ -26,6 +26,8 @@ export default class RegisterScreen extends Component {
password
:
''
,
password
:
''
,
cfPassword
:
''
,
cfPassword
:
''
,
phoneNum
:
''
,
phoneNum
:
''
,
passVisible
:
false
,
cfPassVisible
:
false
,
};
};
submitForm
()
{
submitForm
()
{
...
@@ -117,6 +119,8 @@ export default class RegisterScreen extends Component {
...
@@ -117,6 +119,8 @@ export default class RegisterScreen extends Component {
customStyle
=
{
theme
.
input
}
customStyle
=
{
theme
.
input
}
placeholder
=
"Password"
placeholder
=
"Password"
isPass
=
{
true
}
isPass
=
{
true
}
passVisible
=
{
this
.
state
.
passVisible
}
onPressEye
=
{()
=>
this
.
setState
({
passVisible
:
!
this
.
state
.
passVisible
})}
/
>
/
>
{
/* ---cf password--- */
}
{
/* ---cf password--- */
}
<
Field
<
Field
...
@@ -129,6 +133,8 @@ export default class RegisterScreen extends Component {
...
@@ -129,6 +133,8 @@ export default class RegisterScreen extends Component {
customStyle
=
{
theme
.
input
}
customStyle
=
{
theme
.
input
}
placeholder
=
"Confirm password"
placeholder
=
"Confirm password"
isPass
=
{
true
}
isPass
=
{
true
}
passVisible
=
{
this
.
state
.
cfPassVisible
}
onPressEye
=
{()
=>
this
.
setState
({
cfPassVisible
:
!
this
.
state
.
cfPassVisible
})}
/
>
/
>
{
/* ---phone no--- */
}
{
/* ---phone no--- */
}
<
Field
<
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