mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #4906 from sttatusx/fix-remove-useless-fragments
Remove useless fragments
This commit is contained in:
commit
9670234290
6 changed files with 129 additions and 139 deletions
|
@ -90,6 +90,7 @@ module.exports = {
|
||||||
|
|
||||||
'react/jsx-filename-extension': ['error', { 'extensions': ['.jsx', '.tsx'] }],
|
'react/jsx-filename-extension': ['error', { 'extensions': ['.jsx', '.tsx'] }],
|
||||||
'react/jsx-no-bind': ['error'],
|
'react/jsx-no-bind': ['error'],
|
||||||
|
'react/jsx-no-useless-fragment': ['error'],
|
||||||
'react/jsx-no-constructed-context-values': ['error'],
|
'react/jsx-no-constructed-context-values': ['error'],
|
||||||
'react/no-array-index-key': ['error'],
|
'react/no-array-index-key': ['error'],
|
||||||
|
|
||||||
|
|
|
@ -18,33 +18,32 @@ const GenresItemsContainer: FC<GenresItemsContainerProps> = ({
|
||||||
collectionType,
|
collectionType,
|
||||||
itemType
|
itemType
|
||||||
}) => {
|
}) => {
|
||||||
const { isLoading, data: genresResult } = useGetGenres(
|
const { isLoading, data: genresResult } = useGetGenres(itemType, parentId);
|
||||||
itemType,
|
|
||||||
parentId
|
|
||||||
);
|
|
||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return <Loading />;
|
return <Loading />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!genresResult?.Items?.length) {
|
||||||
|
return (
|
||||||
|
<div className='noItemsMessage centerMessage'>
|
||||||
|
<h1>{globalize.translate('MessageNothingHere')}</h1>
|
||||||
|
<p>{globalize.translate('MessageNoGenresAvailable')}</p>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{!genresResult?.Items?.length ? (
|
{genresResult.Items.map((genre) => (
|
||||||
<div className='noItemsMessage centerMessage'>
|
<GenresSectionContainer
|
||||||
<h1>{globalize.translate('MessageNothingHere')}</h1>
|
key={genre.Id}
|
||||||
<p>{globalize.translate('MessageNoGenresAvailable')}</p>
|
collectionType={collectionType}
|
||||||
</div>
|
parentId={parentId}
|
||||||
) : (
|
itemType={itemType}
|
||||||
genresResult?.Items?.map((genre) => (
|
genre={genre}
|
||||||
<GenresSectionContainer
|
/>
|
||||||
key={genre.Id}
|
))}
|
||||||
collectionType={collectionType}
|
|
||||||
parentId={parentId}
|
|
||||||
itemType={itemType}
|
|
||||||
genre={genre}
|
|
||||||
/>
|
|
||||||
))
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -209,107 +209,99 @@ const FilterButton: FC<FilterButtonProps> = ({
|
||||||
</AccordionDetails>
|
</AccordionDetails>
|
||||||
</Accordion>
|
</Accordion>
|
||||||
{isFiltersSeriesStatusEnabled() && (
|
{isFiltersSeriesStatusEnabled() && (
|
||||||
<>
|
<Accordion
|
||||||
<Accordion
|
expanded={expanded === 'filtersSeriesStatus'}
|
||||||
expanded={expanded === 'filtersSeriesStatus'}
|
onChange={handleChange('filtersSeriesStatus')}
|
||||||
onChange={handleChange('filtersSeriesStatus')}
|
>
|
||||||
|
<AccordionSummary
|
||||||
|
aria-controls='filtersSeriesStatus-content'
|
||||||
|
id='filtersSeriesStatus-header'
|
||||||
>
|
>
|
||||||
<AccordionSummary
|
<Typography>
|
||||||
aria-controls='filtersSeriesStatus-content'
|
{globalize.translate('HeaderSeriesStatus')}
|
||||||
id='filtersSeriesStatus-header'
|
</Typography>
|
||||||
>
|
</AccordionSummary>
|
||||||
<Typography>
|
<AccordionDetails>
|
||||||
{globalize.translate('HeaderSeriesStatus')}
|
<FiltersSeriesStatus
|
||||||
</Typography>
|
libraryViewSettings={libraryViewSettings}
|
||||||
</AccordionSummary>
|
setLibraryViewSettings={
|
||||||
<AccordionDetails>
|
setLibraryViewSettings
|
||||||
<FiltersSeriesStatus
|
}
|
||||||
libraryViewSettings={libraryViewSettings}
|
/>
|
||||||
setLibraryViewSettings={
|
</AccordionDetails>
|
||||||
setLibraryViewSettings
|
</Accordion>
|
||||||
}
|
|
||||||
/>
|
|
||||||
</AccordionDetails>
|
|
||||||
</Accordion>
|
|
||||||
</>
|
|
||||||
)}
|
)}
|
||||||
{isFiltersEpisodesStatusEnabled() && (
|
{isFiltersEpisodesStatusEnabled() && (
|
||||||
<>
|
<Accordion
|
||||||
<Accordion
|
expanded={expanded === 'filtersEpisodesStatus'}
|
||||||
expanded={expanded === 'filtersEpisodesStatus'}
|
onChange={handleChange('filtersEpisodesStatus')}
|
||||||
onChange={handleChange('filtersEpisodesStatus')}
|
>
|
||||||
|
<AccordionSummary
|
||||||
|
aria-controls='filtersEpisodesStatus-content'
|
||||||
|
id='filtersEpisodesStatus-header'
|
||||||
>
|
>
|
||||||
<AccordionSummary
|
<Typography>
|
||||||
aria-controls='filtersEpisodesStatus-content'
|
{globalize.translate(
|
||||||
id='filtersEpisodesStatus-header'
|
'HeaderEpisodesStatus'
|
||||||
>
|
)}
|
||||||
<Typography>
|
</Typography>
|
||||||
{globalize.translate(
|
</AccordionSummary>
|
||||||
'HeaderEpisodesStatus'
|
<AccordionDetails>
|
||||||
)}
|
<FiltersEpisodesStatus
|
||||||
</Typography>
|
libraryViewSettings={libraryViewSettings}
|
||||||
</AccordionSummary>
|
setLibraryViewSettings={
|
||||||
<AccordionDetails>
|
setLibraryViewSettings
|
||||||
<FiltersEpisodesStatus
|
}
|
||||||
libraryViewSettings={libraryViewSettings}
|
/>
|
||||||
setLibraryViewSettings={
|
</AccordionDetails>
|
||||||
setLibraryViewSettings
|
</Accordion>
|
||||||
}
|
|
||||||
/>
|
|
||||||
</AccordionDetails>
|
|
||||||
</Accordion>
|
|
||||||
</>
|
|
||||||
)}
|
)}
|
||||||
{isFiltersFeaturesEnabled() && (
|
{isFiltersFeaturesEnabled() && (
|
||||||
<>
|
<Accordion
|
||||||
<Accordion
|
expanded={expanded === 'filtersFeatures'}
|
||||||
expanded={expanded === 'filtersFeatures'}
|
onChange={handleChange('filtersFeatures')}
|
||||||
onChange={handleChange('filtersFeatures')}
|
>
|
||||||
|
<AccordionSummary
|
||||||
|
aria-controls='filtersFeatures-content'
|
||||||
|
id='filtersFeatures-header'
|
||||||
>
|
>
|
||||||
<AccordionSummary
|
<Typography>
|
||||||
aria-controls='filtersFeatures-content'
|
{globalize.translate('Features')}
|
||||||
id='filtersFeatures-header'
|
</Typography>
|
||||||
>
|
</AccordionSummary>
|
||||||
<Typography>
|
<AccordionDetails>
|
||||||
{globalize.translate('Features')}
|
<FiltersFeatures
|
||||||
</Typography>
|
libraryViewSettings={libraryViewSettings}
|
||||||
</AccordionSummary>
|
setLibraryViewSettings={
|
||||||
<AccordionDetails>
|
setLibraryViewSettings
|
||||||
<FiltersFeatures
|
}
|
||||||
libraryViewSettings={libraryViewSettings}
|
/>
|
||||||
setLibraryViewSettings={
|
</AccordionDetails>
|
||||||
setLibraryViewSettings
|
</Accordion>
|
||||||
}
|
|
||||||
/>
|
|
||||||
</AccordionDetails>
|
|
||||||
</Accordion>
|
|
||||||
</>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{isFiltersVideoTypesEnabled() && (
|
{isFiltersVideoTypesEnabled() && (
|
||||||
<>
|
<Accordion
|
||||||
<Accordion
|
expanded={expanded === 'filtersVideoTypes'}
|
||||||
expanded={expanded === 'filtersVideoTypes'}
|
onChange={handleChange('filtersVideoTypes')}
|
||||||
onChange={handleChange('filtersVideoTypes')}
|
>
|
||||||
|
<AccordionSummary
|
||||||
|
aria-controls='filtersVideoTypes-content'
|
||||||
|
id='filtersVideoTypes-header'
|
||||||
>
|
>
|
||||||
<AccordionSummary
|
<Typography>
|
||||||
aria-controls='filtersVideoTypes-content'
|
{globalize.translate('HeaderVideoType')}
|
||||||
id='filtersVideoTypes-header'
|
</Typography>
|
||||||
>
|
</AccordionSummary>
|
||||||
<Typography>
|
<AccordionDetails>
|
||||||
{globalize.translate('HeaderVideoType')}
|
<FiltersVideoTypes
|
||||||
</Typography>
|
libraryViewSettings={libraryViewSettings}
|
||||||
</AccordionSummary>
|
setLibraryViewSettings={
|
||||||
<AccordionDetails>
|
setLibraryViewSettings
|
||||||
<FiltersVideoTypes
|
}
|
||||||
libraryViewSettings={libraryViewSettings}
|
/>
|
||||||
setLibraryViewSettings={
|
</AccordionDetails>
|
||||||
setLibraryViewSettings
|
</Accordion>
|
||||||
}
|
|
||||||
/>
|
|
||||||
</AccordionDetails>
|
|
||||||
</Accordion>
|
|
||||||
</>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{isFiltersLegacyEnabled() && (
|
{isFiltersLegacyEnabled() && (
|
||||||
|
@ -431,30 +423,28 @@ const FilterButton: FC<FilterButtonProps> = ({
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{isFiltersStudiosEnabled() && (
|
{isFiltersStudiosEnabled() && (
|
||||||
<>
|
<Accordion
|
||||||
<Accordion
|
expanded={expanded === 'filtersStudios'}
|
||||||
expanded={expanded === 'filtersStudios'}
|
onChange={handleChange('filtersStudios')}
|
||||||
onChange={handleChange('filtersStudios')}
|
>
|
||||||
|
<AccordionSummary
|
||||||
|
aria-controls='filtersStudios-content'
|
||||||
|
id='filtersStudios-header'
|
||||||
>
|
>
|
||||||
<AccordionSummary
|
<Typography>
|
||||||
aria-controls='filtersStudios-content'
|
{globalize.translate('Studios')}
|
||||||
id='filtersStudios-header'
|
</Typography>
|
||||||
>
|
</AccordionSummary>
|
||||||
<Typography>
|
<AccordionDetails>
|
||||||
{globalize.translate('Studios')}
|
<FiltersStudios
|
||||||
</Typography>
|
filters={studios}
|
||||||
</AccordionSummary>
|
libraryViewSettings={libraryViewSettings}
|
||||||
<AccordionDetails>
|
setLibraryViewSettings={
|
||||||
<FiltersStudios
|
setLibraryViewSettings
|
||||||
filters={studios}
|
}
|
||||||
libraryViewSettings={libraryViewSettings}
|
/>
|
||||||
setLibraryViewSettings={
|
</AccordionDetails>
|
||||||
setLibraryViewSettings
|
</Accordion>
|
||||||
}
|
|
||||||
/>
|
|
||||||
</AccordionDetails>
|
|
||||||
</Accordion>
|
|
||||||
</>
|
|
||||||
)}
|
)}
|
||||||
</Popover>
|
</Popover>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import React, { FunctionComponent, useEffect } from 'react';
|
import { FunctionComponent, useEffect } from 'react';
|
||||||
import { useLocation } from 'react-router-dom';
|
import { useLocation } from 'react-router-dom';
|
||||||
|
|
||||||
import ServerConnections from './ServerConnections';
|
import ServerConnections from './ServerConnections';
|
||||||
|
@ -56,7 +56,7 @@ const ServerContentPage: FunctionComponent<ServerContentPageProps> = ({ view })
|
||||||
location.search
|
location.search
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return <></>;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ServerContentPage;
|
export default ServerContentPage;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import React, { FunctionComponent, useEffect } from 'react';
|
import { FunctionComponent, useEffect } from 'react';
|
||||||
|
|
||||||
import loading from './loading';
|
import loading from './loading';
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ const Loading: FunctionComponent = () => {
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return <></>;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Loading;
|
export default Loading;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import React, { FunctionComponent, useEffect } from 'react';
|
import { FunctionComponent, useEffect } from 'react';
|
||||||
import { useLocation } from 'react-router-dom';
|
import { useLocation } from 'react-router-dom';
|
||||||
|
|
||||||
import globalize from '../../scripts/globalize';
|
import globalize from '../../scripts/globalize';
|
||||||
|
@ -79,7 +79,7 @@ const ViewManagerPage: FunctionComponent<ViewManagerPageProps> = ({
|
||||||
location.search
|
location.search
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return <></>;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ViewManagerPage;
|
export default ViewManagerPage;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue