Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
PPL KI Ganjil 2021 2022
Clicks - Ecosystem Business
clicks-frontend
Commits
dae99f25
Commit
dae99f25
authored
Oct 10, 2021
by
Abraham Rudolf Brahmana
Committed by
Ahmad Izzudin Alifyandra
Oct 10, 2021
Browse files
Fix: Navigation ecosystem
parent
5d70c22e
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/hooks/reduxHooks.ts
View file @
dae99f25
import
{
TypedUseSelectorHook
,
useDispatch
,
useSelector
}
from
"
react-redux
"
;
import
type
{
RootState
,
AppDispatch
}
from
"
../redux/store
"
;
import
{
IUser
}
from
"
../types/firestore/User
"
;
// Use throughout your app instead of plain `useDispatch` and `useSelector`
export
const
useAppDispatch
=
()
=>
useDispatch
<
AppDispatch
>
();
export
const
useAppSelector
:
TypedUseSelectorHook
<
RootState
>
=
useSelector
;
export
const
useUser
=
()
=>
useAppSelector
((
state
)
=>
state
.
user
);
export
const
useUser
=
()
:
IUser
=>
useAppSelector
((
state
)
=>
state
.
user
);
src/navigation/EcosystemStackNavigator.tsx
View file @
dae99f25
...
...
@@ -4,11 +4,11 @@ import BusinessEcosystemScreen from "../screens/ecosystem/BusinessEcosystemScree
import
{
EcosystemStackParamList
}
from
"
../types/navigation/EcosystemStack
"
;
import
{
BusinessCategoryScreen
,
UserListScreen
,
EcosystemDetailScreen
,
EcosystemListScreen
,
EcosystemMapScreen
,
RecommendedEcosystemScreen
,
UserListScreen
,
}
from
"
../screens/ecosystem
"
;
const
EcosystemStack
=
createNativeStackNavigator
<
EcosystemStackParamList
>
();
...
...
src/screens/ecosystem/BusinessEcosystemScreen.tsx
View file @
dae99f25
...
...
@@ -33,7 +33,13 @@ const BusinessEcosystemScreen = () => {
<
View
>
<
TouchableOpacity
onPress
=
{
()
=>
{
nav
.
navigate
(
"
Ecosystem
"
,
{
screen
:
"
MyEcosystem
"
});
nav
.
navigate
(
"
Ecosystem
"
,
{
screen
:
"
Recommended
"
,
params
:
{
headerTitle
:
"
Ekosistem Saya
"
,
toFetch
:
"
myEcosystem
"
,
},
});
}
}
>
<
Text
style
=
{
styles
.
link
}
>
Ekosistem Saya
</
Text
>
...
...
@@ -65,7 +71,13 @@ const BusinessEcosystemScreen = () => {
<
View
>
<
TouchableOpacity
onPress
=
{
()
=>
{
nav
.
navigate
(
"
Ecosystem
"
,
{
screen
:
"
Popular
"
});
nav
.
navigate
(
"
Ecosystem
"
,
{
screen
:
"
Recommended
"
,
params
:
{
headerTitle
:
"
Paling Populer
"
,
toFetch
:
"
popular
"
,
},
});
}
}
>
<
Text
style
=
{
styles
.
link
}
>
Paling Populer
</
Text
>
...
...
@@ -75,7 +87,13 @@ const BusinessEcosystemScreen = () => {
<
View
>
<
TouchableOpacity
onPress
=
{
()
=>
{
nav
.
navigate
(
"
Ecosystem
"
,
{
screen
:
"
Latest
"
});
nav
.
navigate
(
"
Ecosystem
"
,
{
screen
:
"
Recommended
"
,
params
:
{
headerTitle
:
"
Terbaru Minggu Ini
"
,
toFetch
:
"
mostRecent
"
,
},
});
}
}
>
<
Text
style
=
{
styles
.
link
}
>
Terbaru Minggu Ini
</
Text
>
...
...
src/screens/ecosystem/RecommendedEcosystemScreen.tsx
View file @
dae99f25
import
*
as
React
from
"
react
"
;
import
{
Alert
,
StyleSheet
}
from
"
react-native
"
;
import
{
StyleSheet
}
from
"
react-native
"
;
import
{
Text
,
View
}
from
"
../../components/Themed
"
;
import
Colors
from
"
../../constants/Colors
"
;
import
{
EcosystemStackScreenProps
}
from
"
../../types/navigation
"
;
import
{
LogBox
}
from
"
react-native
"
;
const
RecommendedEcosystemScreen
=
({
route
,
}:
EcosystemStackScreenProps
<
"
Recommended
"
>
)
=>
{
const
{
toFetch
}
=
route
.
params
;
switch
(
toFetch
)
{
case
"
popular
"
:
break
;
case
"
myEcosystem
"
:
break
;
case
"
mostRecent
"
:
break
;
case
"
joined
"
:
break
;
default
:
break
;
}
LogBox
.
ignoreLogs
([
"
Non-serializable values were found in the navigation state
"
,
]);
return
(
<
View
style
=
{
styles
.
container
}
>
<
View
>
<
Text
onPress
=
{
()
=>
Alert
.
alert
(
toFetch
)
}
>
Layar Rekomendasi Ekosistem
</
Text
>
<
Text
>
Layar Rekomendasi Ekosistem
</
Text
>
</
View
>
</
View
>
);
...
...
src/screens/ecosystem/UserListScreen.tsx
View file @
dae99f25
...
...
@@ -7,7 +7,7 @@ const UserListScreen = () => {
return
(
<
View
style
=
{
styles
.
container
}
>
<
View
>
<
Text
>
Layar List
Bisnis
</
Text
>
<
Text
>
Layar List
User
</
Text
>
</
View
>
</
View
>
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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