Show manga description only if available
This commit is contained in:
@@ -183,10 +183,13 @@ const DescriptionGenre = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const [isCollapsed, setIsCollapsed] = useLocalStorage('isDescriptionGenreCollapsed', true);
|
const [isCollapsed, setIsCollapsed] = useLocalStorage('isDescriptionGenreCollapsed', true);
|
||||||
|
|
||||||
|
const collapsedSize = description ? DESCRIPTION_COLLAPSED_SIZE : 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
{description && (
|
||||||
<Stack sx={{ position: 'relative' }}>
|
<Stack sx={{ position: 'relative' }}>
|
||||||
<Collapse collapsedSize={DESCRIPTION_COLLAPSED_SIZE} in={!isCollapsed}>
|
<Collapse collapsedSize={collapsedSize} in={!isCollapsed}>
|
||||||
<Typography style={{ whiteSpace: 'pre-line', textAlign: 'justify', textJustify: 'inter-word' }}>
|
<Typography style={{ whiteSpace: 'pre-line', textAlign: 'justify', textJustify: 'inter-word' }}>
|
||||||
{description}
|
{description}
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -200,7 +203,8 @@ const DescriptionGenre = ({
|
|||||||
position: isCollapsed ? 'absolute' : null,
|
position: isCollapsed ? 'absolute' : null,
|
||||||
width: '100%',
|
width: '100%',
|
||||||
bottom: 0,
|
bottom: 0,
|
||||||
background: (theme) => `linear-gradient(transparent 1px, ${theme.palette.background.default})`,
|
background: (theme) =>
|
||||||
|
`linear-gradient(transparent 1px, ${theme.palette.background.default})`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<IconButton sx={{ color: (theme) => (theme.palette.mode === 'light' ? 'black' : 'text') }}>
|
<IconButton sx={{ color: (theme) => (theme.palette.mode === 'light' ? 'black' : 'text') }}>
|
||||||
@@ -208,6 +212,7 @@ const DescriptionGenre = ({
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
)}
|
||||||
<Stack
|
<Stack
|
||||||
sx={{
|
sx={{
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
|
|||||||
Reference in New Issue
Block a user