Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
2020
PPL-C
PPTI-Mobile Apps Monitoring Wabah Tuberkolosis
Neza-Mobile
Commits
99b9d264
Commit
99b9d264
authored
Apr 09, 2020
by
Josh Sudung
Browse files
Merge branch 'coldfix-sprint_2' into 'staging'
Coldfix sprint 2 See merge request
!19
parents
205de235
7bd58b65
Pipeline
#39776
passed with stages
in 10 minutes and 18 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/App/index.tsx
View file @
99b9d264
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'
react
'
;
import
React
,
{
useState
,
useEffect
,
useReducer
,
useRef
}
from
'
react
'
;
import
styled
,
{
ThemeProvider
}
from
'
styled-components/native
'
;
import
{
NavigationContainer
}
from
'
@react-navigation/native
'
;
import
{
createStackNavigator
}
from
'
@react-navigation/stack
'
;
...
...
@@ -101,10 +101,9 @@ function cacheReducer(oldCache: CacheType, action: CacheAction): CacheType {
}
const
App
=
()
=>
{
const
[
cache
,
setCache
]
=
useState
<
CacheType
>
(
initialCacheState
);
const
[
cache
,
cacheDispatch
]
=
useReducer
(
cacheReducer
,
initialCacheState
);
const
[
token
,
setToken
]
=
useState
();
const
[
user
,
setUser
]
=
useState
();
const
[
isFirstTimeHandleToken
,
setIsFirstTimeHandleToken
]
=
useState
(
true
);
const
navigatorRef
=
useRef
()
const
mainService
=
useMainService
(
token
);
...
...
src/components/Field/index.tsx
View file @
99b9d264
...
...
@@ -63,6 +63,12 @@ function Field({
const
{
colors
}
=
useContext
(
ThemeContext
)
||
{};
const
[
innerValue
,
setInnerValue
]
=
useState
(
value
);
useEffect
(()
=>
{
if
(
values
&&
values
.
length
>
0
&&
type
===
Type
.
Dropdown
)
{
setInnerValue
(
values
[
0
].
value
)
}
},
[])
useEffect
(()
=>
{
updateValue
(
innerValue
);
},
[
innerValue
]);
...
...
src/components/Header/index.tsx
View file @
99b9d264
...
...
@@ -45,7 +45,7 @@ const Header = ({
<
HomeButton
>
<
Button
type
=
{
Button
.
Type
.
Outline
}
onPress
=
{
()
=>
navigation
.
navigate
(
"
home
"
)
}
onPress
=
{
()
=>
global
.
isAuthenticated
?
navigation
.
navigate
(
"
home
"
)
:
navigation
.
navigate
(
"
login
"
)
}
>
Beranda
</
Button
>
...
...
src/scenes/FinishPage/ContactInvestigationFormFinishPage/index.tsx
View file @
99b9d264
...
...
@@ -27,7 +27,12 @@ const ContactInvestigationFormFinishPage = () => {
</
Text
>
</
ContainerContent
>
<
ContainerButton
>
<
Button
type
=
{
1
}
onPress
=
{
()
=>
navigation
.
navigate
(
'
home
'
)
}
>
<
Button
type
=
{
1
}
onPress
=
{
()
=>
{
navigation
.
reset
({
index
:
0
,
routes
:
[{
name
:
'
home
'
}],
});
}
}
>
Kembali ke Beranda
</
Button
>
</
ContainerButton
>
...
...
src/scenes/FinishPage/OfficerSignupFormFinishPage/index.tsx
View file @
99b9d264
...
...
@@ -36,7 +36,12 @@ const OfficerSignupFormFinishPage = () => {
</
FieldControl
>
</
ContainerContent
>
<
ContainerButton
>
<
Button
type
=
{
1
}
onPress
=
{
()
=>
navigation
.
navigate
(
'
login
'
)
}
>
<
Button
type
=
{
1
}
onPress
=
{
()
=>
{
navigation
.
reset
({
index
:
0
,
routes
:
[{
name
:
'
login
'
}],
})
}
}
>
Kembali ke Halaman Login
</
Button
>
</
ContainerButton
>
...
...
src/scenes/OfficerSignupForm/index.tsx
View file @
99b9d264
...
...
@@ -191,7 +191,10 @@ const OfficerSignupForm = () => {
if
(
response
.
status
===
201
)
{
setIsLoading
(
false
);
navigation
.
navigate
(
"
officer-signup-finish
"
);
navigation
.
reset
({
index
:
0
,
routes
:
[{
name
:
"
officer-signup-finish
"
}],
});
}
else
if
(
response
.
status
===
500
)
{
if
(
response
.
data
.
includes
(
"
IntegrityError
"
))
{
setServerHasError
(
false
);
...
...
src/services/hooks/useMainService/index.tsx
View file @
99b9d264
...
...
@@ -6,7 +6,7 @@ const END_POINTS = {
SIGNUP
:
'
/signup
'
,
ME
:
'
/accounts/me/
'
,
ACCOUNT
:
'
/accounts/
'
,
CREATE_CASE_SUBJECT
:
"
cases/case-subjects
"
,
CREATE_CASE_SUBJECT
:
"
/
cases/case-subjects
"
,
CREATE_INVESTIGATION_CASE
:
"
/cases/investigation-cases
"
,
GET_LOG
:
"
/logs
"
,
LIST_POSITIVE_CASE
:
"
/cases/positive-cases
"
,
...
...
Write
Preview
Supports
Markdown
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