Skip to content

Commit 02d0637

Browse files
committed
[Revert] Revert #2075
1 parent 6a7be0f commit 02d0637

File tree

3 files changed

+30
-107
lines changed

3 files changed

+30
-107
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@
155155
"react-dom": "^18.2.0",
156156
"react-i18next": "^11.16.7",
157157
"react-markdown": "^8.0.3",
158-
"react-infinite-scroll-hook": "^4.0.4",
159158
"react-router-dom": "^6.3.0",
160159
"recharts": "^2.1.14",
161160
"shlex": "^2.1.2",

src/frontend/hooks/usePaginatedList.ts

Lines changed: 0 additions & 53 deletions
This file was deleted.

src/frontend/screens/Library/components/GamesList/index.tsx

Lines changed: 30 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import cx from 'classnames'
44
import GameCard from '../GameCard'
55
import ContextProvider from 'frontend/state/ContextProvider'
66
import { useTranslation } from 'react-i18next'
7-
import usePaginatedList from 'frontend/hooks/usePaginatedList'
87

98
interface Props {
109
library: GameInfo[]
@@ -30,51 +29,9 @@ const GamesList = ({
3029
const { gameUpdates } = useContext(ContextProvider)
3130
const { t } = useTranslation()
3231

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-
6932
return (
7033
<div
71-
style={
72-
!library.length
73-
? {
74-
backgroundColor: 'transparent'
75-
}
76-
: {}
77-
}
34+
style={!library.length ? { backgroundColor: 'transparent' } : {}}
7835
className={cx({
7936
gameList: layout === 'grid',
8037
gameListLayout: layout === 'list',
@@ -89,15 +46,35 @@ const GamesList = ({
8946
<span>{t('wine.actions', 'Action')}</span>
9047
</div>
9148
)}
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+
})}
10178
</div>
10279
)
10380
}

0 commit comments

Comments
 (0)