Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IT2810 H20
Team Ad Hoc
4-t-h
Commits
f151469a
Commit
f151469a
authored
Nov 13, 2020
by
Thor-Herman
Browse files
Create FilterPage and route
#7
#12
parent
504590b8
Changes
3
Show whitespace changes
Inline
Side-by-side
prosjekt-4/components/App.tsx
View file @
f151469a
...
...
@@ -10,11 +10,13 @@ import SearchBar from './SearchBar';
import
Header
from
'
./Header
'
;
import
{
createStackNavigator
}
from
'
@react-navigation/stack
'
;
import
{
NavigationContainer
}
from
'
@react-navigation/native
'
;
import
FilterPage
from
'
../pages/FilterPage
'
;
export
type
StackParamList
=
{
Browse
:
undefined
;
Movie
:
{
id
:
number
};
Filter
:
undefined
,
};
const
Stack
=
createStackNavigator
<
StackParamList
>
();
...
...
@@ -35,6 +37,7 @@ const App = () => {
<
Stack
.
Navigator
initialRouteName
=
'Browse'
>
<
Stack
.
Screen
name
=
'Browse'
component
=
{
BrowsePage
}
/>
<
Stack
.
Screen
name
=
'Movie'
component
=
{
MoviePage
}
/>
<
Stack
.
Screen
name
=
'Filter'
component
=
{
FilterPage
}
/>
</
Stack
.
Navigator
>
</
Container
>
</
NavigationContainer
>
...
...
prosjekt-4/pages/BrowsePage.tsx
View file @
f151469a
...
...
@@ -11,7 +11,7 @@ import PaginationButton from '../components/PaginationButton';
import
SearchBar
from
'
../components/SearchBar
'
;
import
{
selectMoviesByAllIdsOrdering
}
from
'
../selectors/movieSelector
'
;
type
BrowseScreenNavigationProp
=
StackNavigationProp
<
StackParamList
,
'
Movi
e
'
>
;
type
BrowseScreenNavigationProp
=
StackNavigationProp
<
StackParamList
,
'
Brows
e
'
>
;
type
Props
=
{
navigation
:
BrowseScreenNavigationProp
;
};
...
...
@@ -44,7 +44,12 @@ const BrowsePage = ({navigation}: Props) => {
return
(
<
Content
>
<
View
>
<
SearchBar
/>
<
Button
onPress
=
{
()
=>
navigation
.
navigate
(
'
Filter
'
)
}
>
<
Text
>
Filter
</
Text
>
</
Button
>
</
View
>
{
determineRender
()
}
<
PaginationButton
/>
</
Content
>
...
...
prosjekt-4/pages/FilterPage.tsx
0 → 100644
View file @
f151469a
import
React
from
"
react
"
;
import
{
Text
}
from
"
native-base
"
;
import
{
StackParamList
}
from
"
../components/App
"
;
import
{
StackNavigationProp
}
from
'
@react-navigation/stack
'
;
type
FilterScreenNavigationProp
=
StackNavigationProp
<
StackParamList
,
'
Filter
'
>
;
type
Props
=
{
navigation
:
FilterScreenNavigationProp
;
};
const
FilterPage
=
({
navigation
}:
Props
)
=>
{
return
<
Text
>
FilterPage
</
Text
>;
};
export
default
FilterPage
;
Thor-Herman Van Eggelen
@theggele
mentioned in commit
b6223b73
·
Nov 13, 2020
mentioned in commit
b6223b73
mentioned in commit b6223b73e0413e03a52be165ce7379a58ca587c7
Toggle commit list
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