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 H21
Team 29
iWhatToWatch
Commits
882bd88b
Commit
882bd88b
authored
Nov 22, 2021
by
Dherik Jenitan Devakumar
Browse files
Merge branch '14-fix-infinite-scroll-not-working'
parents
c5a01f3e
0cbe945a
Changes
5
Hide whitespace changes
Inline
Side-by-side
frontend/src/components/moviesview/index.tsx
View file @
882bd88b
...
...
@@ -18,10 +18,15 @@ import { TouchableOpacity, TouchableWithoutFeedback } from 'react-native';
*/
interface
IMovieObject
{
item
:
searchMovies_getMoviesBySearch
;
item
:
searchMovies_getMoviesBySearch
;
}
const
MovieTable
:
React
.
FC
=
()
=>
{
interface
MovieTableProps
{
fetchMore
:
()
=>
void
;
}
const
MovieTable
:
React
.
FC
<
MovieTableProps
>
=
({
fetchMore
})
=>
{
const
movies
=
useSelector
(
selectMovies
);
const
isLoggedIn
=
useSelector
(
selectUserIsLoggedIn
);
const
userName
=
useSelector
(
selectUserName
)
...
...
@@ -83,8 +88,7 @@ const MovieTable: React.FC = () => {
contentContainerStyle
=
{
{
paddingBottom
:
350
,
}
}
onEndReachedThreshold
=
{
0.5
}
onEndReached
=
{
()
=>
{
console
.
log
(
"
test
"
)}
}
onEndReached
=
{
fetchMore
}
/>
<
MovieModal
isModalVisible
=
{
modalVisible
}
setIsModalVisible
=
{
setModalVisible
}
movie
=
{
modalMovie
}
/>
</
SafeAreaView
>
...
...
frontend/src/graphql/index.ts
View file @
882bd88b
import
{
ApolloClient
,
InMemoryCache
}
from
"
@apollo/client
"
;
import
{
DB_URL
}
from
"
@env
"
;
//import "dotenv/config"
//console.log(process.env.DB_URL)
console
.
log
(
DB_URL
)
export
const
apolloClient
=
new
ApolloClient
({
uri
:
process
.
env
.
DB_URL
?
process
.
env
.
DB_URL
:
"
http://localhost:4000/graphql
"
,
cache
:
new
InMemoryCache
(),
...
...
frontend/src/pages/MainPage.tsx
View file @
882bd88b
...
...
@@ -115,7 +115,8 @@ export const MainPage: FunctionComponent = () => {
<
SortDropDown
/>
</
View
>
<
View
>
<
MovieTable
/>
{
/* <BottomScrollListener onBottom={fetchMovies} debounce={0}/> */
}
<
MovieTable
fetchMore
=
{
fetchMovies
}
/>
</
View
>
</
View
>
</
MenuDrawer
>
...
...
frontend/src/pages/mainPageSlice.ts
View file @
882bd88b
...
...
@@ -17,14 +17,12 @@ const MainPageSlice = createSlice({
initialState
,
reducers
:
{
setMovies
(
state
,
action
)
{
console
.
log
(
"
next page
"
,
state
.
nextPage
);
state
.
nextPage
+=
1
;
if
(
state
.
movies
!==
null
)
{
state
.
movies
=
state
.
movies
.
concat
(
action
.
payload
);
}
},
setSortByCriteria
(
state
,
action
)
{
console
.
log
(
"
Payload
"
,
action
.
payload
);
state
.
nextPage
=
0
;
state
.
movies
=
[];
state
.
sortByCriteria
=
action
.
payload
;
...
...
@@ -41,7 +39,6 @@ const MainPageSlice = createSlice({
state
.
filterSearch
=
action
.
payload
;
},
setFilterGenres
(
state
,
action
)
{
console
.
log
(
"
Payload
"
,
action
.
payload
);
state
.
nextPage
=
0
;
state
.
movies
=
[];
if
(
state
.
filterGenre
===
[
""
])
{
...
...
frontend/src/util/dateConverter.ts
View file @
882bd88b
...
...
@@ -4,7 +4,6 @@ export function convertDateToUnixDate(date: Date) {
export
function
convertUnixDateToDate
(
unixNumber
:
number
)
{
const
date
=
new
Date
(
unixNumber
*
1000
);
//console.log(date.getFullYear());
return
date
;
}
...
...
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