Feature/merge source and extensions screen on desktop (#535)

* Merge "source" and "extension" screen for desktop

* Move "tab" related components into new folder

* Reuse "tab" components for "browse" screen

* Prevent extension list from being taller than 100% of the parents height

- remove margin - virtuoso has issues calculating the height otherwise
- change group title styling, fontSize caused issues

* Align "source" list group header with "extension"

* Remove bottom padding from "ExtensionCard"

* Move "GroupedVirtuoso" related components into folder

* Use "GroupedVirtuoso" for "extensions"

There was an issue with the height calculation of the virtuoso list, which apparently was caused by the conditional rendering of the group title and item as list items.
Due to this, while scrolling down, the virtuoso list caused an overflow, which rendered the scrollbar, which in turn caused the list items to shrink in width.
The end result of this was, that the list items "jumped" slightly on the initial render of the items, due to the scrollbar appearing and disappearing
This commit is contained in:
schroda
2024-01-02 23:32:49 +01:00
committed by GitHub
parent 9caca6e753
commit db65b9df44
15 changed files with 226 additions and 145 deletions

View File

@@ -7,7 +7,7 @@
*/
import { Fragment, useContext, useEffect } from 'react';
import { IconButton, Tooltip } from '@mui/material';
import { IconButton, Tooltip, Typography } from '@mui/material';
import TravelExploreIcon from '@mui/icons-material/TravelExplore';
import { useNavigate } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
@@ -107,9 +107,18 @@ export function Sources() {
([lang, list]) =>
shownLangs.indexOf(lang) !== -1 && (
<Fragment key={lang}>
<h1 key={lang} style={{ marginLeft: 25 }}>
<Typography
key={lang}
variant="h4"
style={{
paddingLeft: '24px',
paddingTop: '6px',
paddingBottom: '16px',
fontWeight: 'bold',
}}
>
{translateExtensionLanguage(lang)}
</h1>
</Typography>
{(list as ISource[])
.filter((source) => showNsfw || !source.isNsfw)
.map((source) => (