Skip to content

Commit a4f5c7d

Browse files
committed
remove virtuoso
1 parent bce7ef5 commit a4f5c7d

3 files changed

Lines changed: 15 additions & 18 deletions

File tree

src/App.css

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,12 @@ a {
196196
display: flex;
197197
flex-direction: column;
198198
overflow-x: hidden;
199+
height: calc(80vh - 1% - 46px);
199200
}
200201

201202
.scrollable {
202203
scrollbar-color: var(--scrollbar-accent-color) var(--scrollbar-background-color);
203204
scrollbar-width: thin;
204-
overflow-y: hidden;
205205
}
206206

207207
.scrollable::-webkit-scrollbar {
@@ -267,6 +267,10 @@ a {
267267
position: relative;
268268
}
269269

270+
.blockRow:last-child {
271+
padding-bottom: 42px;
272+
273+
}
270274
/* Actions */
271275
.blockActions {
272276
position: absolute;
@@ -332,7 +336,8 @@ a {
332336
visibility: visible;
333337
}
334338

335-
.blockContent > div > div > div:not(:last-child), .blockRow:not(:last-child) {
339+
/* .blockContent > div > div > div:not(:last-child), .blockRow:not(:last-child) */
340+
.blockRow:not(:last-child) {
336341
border-bottom: 1px solid var(--card-content-divider);
337342
}
338343

src/components/CardComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function CardComponent({ icon, title, children, fullBlock, link }) {
2222
</a>
2323
)}
2424
</div>
25-
{children}
25+
<div className="blockContent scrollable">{children}</div>
2626
</div>
2727
)
2828
}

src/components/ListComponent.js

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ import { trackException } from '../utils/Analytics'
44
import Placeholder from './Placeholder'
55
import { Virtuoso } from 'react-virtuoso'
66

7-
function ListHeader(withAds) {
8-
if (!withAds) {
9-
return null
10-
}
11-
return <CarbonAd key={'carbonAd0'} />
12-
}
137

148
function ListComponent({ fetchData, refresh, renderItem, withAds, placeholder = <Placeholder /> }) {
159
const [items, setItems] = useState([])
@@ -43,15 +37,13 @@ function ListComponent({ fetchData, refresh, renderItem, withAds, placeholder =
4337
return
4438
}
4539

46-
return (
47-
<Virtuoso
48-
style={{ height: '71vh' }}
49-
className="blockContent scrollable"
50-
components={{ Header: () => ListHeader(withAds) }}
51-
data={items}
52-
itemContent={(index, item) => renderItem(item, index)}
53-
/>
54-
)
40+
return items.map((item, index) => {
41+
let content = [renderItem(item, index)]
42+
if (withAds && index == 0) {
43+
content.unshift(<CarbonAd key={'carbonAd0'} />)
44+
}
45+
return content
46+
})
5547
}
5648

5749
function Placeholders() {

0 commit comments

Comments
 (0)