chore: format JSX components
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
@@ -351,7 +351,9 @@ const AlbumDetails = (props) => {
|
|||||||
variant={'body1'}
|
variant={'body1'}
|
||||||
onClick={() => setExpanded(!expanded)}
|
onClick={() => setExpanded(!expanded)}
|
||||||
>
|
>
|
||||||
<span><SafeHTML>{notes}</SafeHTML></span>
|
<span>
|
||||||
|
<SafeHTML>{notes}</SafeHTML>
|
||||||
|
</span>
|
||||||
</Typography>
|
</Typography>
|
||||||
</Collapse>
|
</Collapse>
|
||||||
)}
|
)}
|
||||||
@@ -371,7 +373,9 @@ const AlbumDetails = (props) => {
|
|||||||
variant={'body1'}
|
variant={'body1'}
|
||||||
onClick={() => setExpanded(!expanded)}
|
onClick={() => setExpanded(!expanded)}
|
||||||
>
|
>
|
||||||
<span><SafeHTML>{notes}</SafeHTML></span>
|
<span>
|
||||||
|
<SafeHTML>{notes}</SafeHTML>
|
||||||
|
</span>
|
||||||
</Typography>
|
</Typography>
|
||||||
</Collapse>
|
</Collapse>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -71,7 +71,9 @@ const ArtistDetails = (props) => {
|
|||||||
}, [record.id])
|
}, [record.id])
|
||||||
|
|
||||||
const Component = isDesktop ? DesktopArtistDetails : MobileArtistDetails
|
const Component = isDesktop ? DesktopArtistDetails : MobileArtistDetails
|
||||||
return <Component artistInfo={artistInfo} record={record} biography={biography} />
|
return (
|
||||||
|
<Component artistInfo={artistInfo} record={record} biography={biography} />
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const ArtistShowLayout = (props) => {
|
const ArtistShowLayout = (props) => {
|
||||||
|
|||||||
@@ -173,7 +173,9 @@ const DesktopArtistDetails = ({ artistInfo, record, biography }) => {
|
|||||||
variant={'body1'}
|
variant={'body1'}
|
||||||
onClick={() => setExpanded(!expanded)}
|
onClick={() => setExpanded(!expanded)}
|
||||||
>
|
>
|
||||||
<span><SafeHTML>{biography}</SafeHTML></span>
|
<span>
|
||||||
|
<SafeHTML>{biography}</SafeHTML>
|
||||||
|
</span>
|
||||||
</Typography>
|
</Typography>
|
||||||
</Collapse>
|
</Collapse>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
|
|||||||
@@ -169,7 +169,9 @@ const MobileArtistDetails = ({ artistInfo, biography, record }) => {
|
|||||||
<div className={classes.biography}>
|
<div className={classes.biography}>
|
||||||
<Collapse collapsedHeight={'1.5em'} in={expanded} timeout={'auto'}>
|
<Collapse collapsedHeight={'1.5em'} in={expanded} timeout={'auto'}>
|
||||||
<Typography variant={'body1'} onClick={() => setExpanded(!expanded)}>
|
<Typography variant={'body1'} onClick={() => setExpanded(!expanded)}>
|
||||||
<span><SafeHTML>{biography}</SafeHTML></span>
|
<span>
|
||||||
|
<SafeHTML>{biography}</SafeHTML>
|
||||||
|
</span>
|
||||||
</Typography>
|
</Typography>
|
||||||
</Collapse>
|
</Collapse>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -28,9 +28,7 @@ export const MultiLineTextField = memo(
|
|||||||
component="span"
|
component="span"
|
||||||
{...sanitizeFieldRestProps(rest)}
|
{...sanitizeFieldRestProps(rest)}
|
||||||
>
|
>
|
||||||
{lines.length === 0 && emptyText
|
{lines.length === 0 && emptyText ? emptyText : lines}
|
||||||
? emptyText
|
|
||||||
: lines}
|
|
||||||
</Typography>
|
</Typography>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
import DOMPurify from 'dompurify'
|
import DOMPurify from 'dompurify'
|
||||||
import { Fragment, useMemo } from 'react'
|
import { Fragment, useMemo } from 'react'
|
||||||
|
|
||||||
export const SafeHTML = ({
|
export const SafeHTML = ({ children }) => {
|
||||||
children,
|
|
||||||
}) => {
|
|
||||||
const purified = useMemo(() => {
|
const purified = useMemo(() => {
|
||||||
const purify = DOMPurify()
|
const purify = DOMPurify()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user