@@ -4,7 +4,6 @@ import cx from 'classnames'
4
4
import GameCard from '../GameCard'
5
5
import ContextProvider from 'frontend/state/ContextProvider'
6
6
import { useTranslation } from 'react-i18next'
7
- import usePaginatedList from 'frontend/hooks/usePaginatedList'
8
7
9
8
interface Props {
10
9
library : GameInfo [ ]
@@ -30,51 +29,9 @@ const GamesList = ({
30
29
const { gameUpdates } = useContext ( ContextProvider )
31
30
const { t } = useTranslation ( )
32
31
33
- const { infiniteScrollSentryRef, paginatedList, hasMore } = usePaginatedList (
34
- library ,
35
- {
36
- rpp : 10 ,
37
- infinite : true
38
- }
39
- )
40
-
41
- const renderGameInfo = ( gameInfo : GameInfo ) => {
42
- const {
43
- app_name,
44
- is_installed,
45
- runner,
46
- install : { is_dlc }
47
- } = gameInfo
48
-
49
- if ( is_dlc ) {
50
- return null
51
- }
52
- if ( ! is_installed && onlyInstalled ) {
53
- return null
54
- }
55
-
56
- const hasUpdate = is_installed && gameUpdates ?. includes ( app_name )
57
- return (
58
- < GameCard
59
- key = { app_name }
60
- hasUpdate = { hasUpdate }
61
- buttonClick = { ( ) => handleGameCardClick ( app_name , runner , gameInfo ) }
62
- forceCard = { layout === 'grid' }
63
- isRecent = { isRecent }
64
- gameInfo = { gameInfo }
65
- />
66
- )
67
- }
68
-
69
32
return (
70
33
< div
71
- style = {
72
- ! library . length
73
- ? {
74
- backgroundColor : 'transparent'
75
- }
76
- : { }
77
- }
34
+ style = { ! library . length ? { backgroundColor : 'transparent' } : { } }
78
35
className = { cx ( {
79
36
gameList : layout === 'grid' ,
80
37
gameListLayout : layout === 'list' ,
@@ -89,15 +46,35 @@ const GamesList = ({
89
46
< span > { t ( 'wine.actions' , 'Action' ) } </ span >
90
47
</ div >
91
48
) }
92
- { paginatedList . map ( ( item ) => {
93
- return renderGameInfo ( item )
94
- } ) }
95
- { hasMore && (
96
- < div
97
- ref = { infiniteScrollSentryRef }
98
- style = { { width : 100 , height : 40 , backgroundColor : 'transparent' } }
99
- />
100
- ) }
49
+ { ! ! library . length &&
50
+ library . map ( ( gameInfo ) => {
51
+ const {
52
+ app_name,
53
+ is_installed,
54
+ runner,
55
+ install : { is_dlc }
56
+ } = gameInfo
57
+ if ( is_dlc ) {
58
+ return null
59
+ }
60
+ if ( ! is_installed && onlyInstalled ) {
61
+ return null
62
+ }
63
+
64
+ const hasUpdate = is_installed && gameUpdates ?. includes ( app_name )
65
+ return (
66
+ < GameCard
67
+ key = { app_name }
68
+ hasUpdate = { hasUpdate }
69
+ buttonClick = { ( ) =>
70
+ handleGameCardClick ( app_name , runner , gameInfo )
71
+ }
72
+ forceCard = { layout === 'grid' }
73
+ isRecent = { isRecent }
74
+ gameInfo = { gameInfo }
75
+ />
76
+ )
77
+ } ) }
101
78
</ div >
102
79
)
103
80
}
0 commit comments