Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Tia-dev
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dida Adams Arizona
Tia-dev
Commits
549b29fe
Commit
549b29fe
authored
Aug 10, 2020
by
EKSAD
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Login
parent
848655b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
26 deletions
+26
-26
Login.js
src/container/Login.js
+18
-14
ResetPassword.js
src/container/ResetPassword.js
+8
-12
No files found.
src/container/Login.js
View file @
549b29fe
...
...
@@ -5,6 +5,7 @@ import { withStyles } from '@material-ui/core/styles';
import
Visibility
from
'@material-ui/icons/Visibility'
;
import
VisibilityOff
from
'@material-ui/icons/VisibilityOff'
;
import
api
from
'../api'
;
import
{
Redirect
}
from
'react-router-dom'
;
const
CustomCheckbox
=
withStyles
({
root
:
{
...
...
@@ -30,20 +31,21 @@ class Login extends Component {
// this.coba()
}
coba
(
e
)
{
this
.
setState
({
username
:
e
})
handleChange
(
e
)
{
let
data
=
this
.
state
this
.
setState
({...
data
,
[
e
.
target
.
name
]
:
e
.
target
.
value
})
}
login
()
{
let
payload
=
{
"username"
:
this
.
state
.
username
,
"password"
:
"admin"
"password"
:
this
.
state
.
password
}
api
.
create
().
login
(
payload
).
then
((
response
)
=>
{
console
.
log
(
response
.
data
)
if
(
response
.
data
.
status
===
'success'
)
{
this
.
props
.
history
.
replace
(
'/home'
)
// console.log(response.data)
}
})
}
...
...
@@ -55,7 +57,7 @@ class Login extends Component {
<
img
src
=
{
Images
.
imageLogin
}
style
=
{{
marginTop
:
30
}}
/
>
<
/div
>
<
div
style
=
{{
width
:
'50%'
,
height
:
'100vh'
,
backgroundColor
:
'#51c6ea'
,
display
:
'flex'
,
justifyContent
:
'center'
,
alignItems
:
'center'
,
flexDirection
:
'column'
}}
>
<
div
style
=
{{
padding
:
60
,
display
:
'flex'
,
flexDirection
:
'column'
,
width
:
318
,
height
:
35
1
,
borderRadius
:
12
,
boxShadow
:
'0 2 4 0 rgba(0, 0, 0, 0.2)'
,
backgroundColor
:
'#ffffff'
}}
>
<
div
style
=
{{
padding
Top
:
56
,
paddingLeft
:
64
,
paddingRight
:
64
,
display
:
'flex'
,
flexDirection
:
'column'
,
width
:
378
,
height
:
43
1
,
borderRadius
:
12
,
boxShadow
:
'0 2 4 0 rgba(0, 0, 0, 0.2)'
,
backgroundColor
:
'#ffffff'
}}
>
<
img
src
=
{
Images
.
tia
}
/
>
<
TextField
...
...
@@ -64,10 +66,10 @@ class Login extends Component {
type
=
{
"text"
}
name
=
{
"username"
}
value
=
{
this
.
state
.
username
}
onChange
=
{(
e
)
=>
this
.
setState
({
username
:
e
.
target
.
value
}
)}
onChange
=
{(
username
)
=>
this
.
handleChange
(
username
)}
variant
=
"outlined"
error
=
{
false
}
style
=
{{
width
:
'100%'
,
height
:
51
,
marginTop
:
32
,
fontSize
:
14
}}
style
=
{{
width
:
250
,
height
:
51
,
marginTop
:
32
,
fontSize
:
14
}}
helperText
=
""
InputProps
=
{{
endAdornment
:
<
InputAdornment
position
=
"end"
><
img
src
=
{
Images
.
email
}
/></
InputAdornment
>
,
...
...
@@ -79,9 +81,11 @@ class Login extends Component {
id
=
"password"
type
=
{
this
.
state
.
showPass
?
'text'
:
'password'
}
name
=
{
"password"
}
value
=
{
this
.
state
.
password
}
onChange
=
{(
password
)
=>
this
.
handleChange
(
password
)
}
variant
=
"outlined"
error
=
{
false
}
style
=
{{
width
:
'100%'
,
height
:
51
,
marginTop
:
20
}}
style
=
{{
width
:
250
,
height
:
51
,
marginTop
:
20
}}
helperText
=
""
InputProps
=
{{
endAdornment
:
<
InputAdornment
position
=
"end"
>
...
...
@@ -99,10 +103,10 @@ class Login extends Component {
<
div
style
=
{{
flexDirection
:
'row'
,
width
:
'100%'
,
marginTop
:
16
}}
>
<
CustomCheckbox
name
=
"checked-remember"
/>
<
span
style
=
{{
color
:
'rgba(0, 0, 0, 0.5)'
}}
>
Remember
Me
<
/span
>
<
span
style
=
{{
marginLeft
:
30
,
color
:
'#51c6ea'
,
cursor
:
'pointer'
}}
>
Lupa
Kata
Sandi
?
<
/span
>
<
span
style
=
{{
color
:
'rgba(0, 0, 0, 0.5)'
,
fontSize
:
12
}}
>
Remember
Me
<
/span
>
<
span
style
=
{{
marginLeft
:
30
,
color
:
'#51c6ea'
,
cursor
:
'pointer'
,
fontSize
:
12
}}
>
Lupa
Kata
Sandi
?
<
/span
>
<
/div
>
<
Button
variant
=
"contained"
onClick
=
{()
=>
this
.
login
()}
style
=
{{
marginTop
:
23
,
width
:
'100%'
,
height
:
35
,
borderRadius
:
4
}}
>
<
Button
name
=
"submit"
variant
=
"contained"
onClick
=
{()
=>
this
.
login
()}
style
=
{{
marginTop
:
23
,
width
:
'100%'
,
height
:
35
,
borderRadius
:
4
}}
>
<
Typography
style
=
{{
fontSize
:
12
}}
>
Login
<
/Typography
>
<
/Button
>
<
/div
>
...
...
src/container/ResetPassword.js
View file @
549b29fe
...
...
@@ -7,22 +7,18 @@ class ResetPassword extends Component {
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
username
:
''
,
password
:
''
username
:
''
}
}
user
(
username
)
{
this
.
setState
({
username
:
username
})
}
handleChange
(
e
)
{
let
data
=
this
.
state
this
.
setState
({...
data
,
[
e
.
target
.
name
]
:
e
.
target
.
value
})
}
render
()
{
return
(
<
div
style
=
{{
flex
:
1
,
display
:
'flex'
,
backgroundColor
:
'#51c6ea'
,
height
:
'100vh'
,
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
<
div
style
=
{{
padding
:
60
,
display
:
'flex'
,
flexDirection
:
'column'
,
width
:
3
18
,
height
:
250
,
borderRadius
:
12
,
boxShadow
:
'0 2 4 0 rgba(0, 0, 0, 0.2)'
,
backgroundColor
:
'#ffffff'
,
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
<
div
style
=
{{
padding
:
60
,
display
:
'flex'
,
flexDirection
:
'column'
,
width
:
3
78
,
height
:
351
,
borderRadius
:
12
,
boxShadow
:
'0 2 4 0 rgba(0, 0, 0, 0.2)'
,
backgroundColor
:
'#ffffff'
,
justifyContent
:
'center'
,
alignItems
:
'center'
}}
>
<
img
src
=
{
Images
.
tia
}
/
>
<
TextField
...
...
@@ -34,14 +30,14 @@ class ResetPassword extends Component {
onChange
=
{(
username
)
=>
this
.
setState
({
username
:
username
.
target
.
value
})}
variant
=
"outlined"
error
=
{
false
}
style
=
{{
width
:
'90%'
,
height
:
51
,
marginTop
:
32
,
fontSize
:
14
}}
style
=
{{
width
:
250
,
height
:
51
,
marginTop
:
32
,
fontSize
:
14
}}
helperText
=
""
InputProps
=
{{
endAdornment
:
<
InputAdornment
position
=
"end"
><
img
src
=
{
Images
.
email
}
/></
InputAdornment
>
,
}}
/
>
<
Button
variant
=
"contained"
style
=
{{
marginTop
:
23
,
width
:
'90%'
,
height
:
30
,
borderRadius
:
4
}}
disabled
>
<
Button
variant
=
"contained"
style
=
{{
marginTop
:
23
,
width
:
250
,
height
:
30
,
borderRadius
:
4
}}
disabled
>
<
Typography
style
=
{{
fontSize
:
12
}}
>
Lanjut
<
/Typography
>
<
/Button
>
...
...
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