mirror of
https://github.com/navidrome/navidrome.git
synced 2026-05-03 06:51:16 +00:00
Refactor share URLs section into accordion in ShareEdit
Replaces the static display of share URLs and embed code with an expandable Accordion component for improved UI organization and user experience in the ShareEdit form.
This commit is contained in:
parent
1baadd8293
commit
bb54195955
@ -8,10 +8,11 @@ import {
|
||||
useTranslate,
|
||||
} from 'react-admin'
|
||||
import { sharePlayerUrl, shareAPlayerUrl } from '../utils'
|
||||
import { Link, Box, Typography, Divider } from '@material-ui/core'
|
||||
import { Link, Box, Typography, Divider, Accordion, AccordionSummary, AccordionDetails } from '@material-ui/core'
|
||||
import { DateField } from '../common'
|
||||
import config from '../config'
|
||||
import { EmbedCodeField } from './EmbedCodeField'
|
||||
import ExpandMoreIcon from '@material-ui/icons/ExpandMore'
|
||||
|
||||
export const ShareEdit = (props) => {
|
||||
const { id, basePath, hasCreate, ...rest } = props
|
||||
@ -21,6 +22,28 @@ export const ShareEdit = (props) => {
|
||||
return (
|
||||
<Edit {...props}>
|
||||
<SimpleForm {...rest}>
|
||||
<TextInput source="description" />
|
||||
{config.enableDownloads && <BooleanInput source="downloadable" />}
|
||||
<DateTimeInput source="expiresAt" />
|
||||
<TextInput source="contents" disabled />
|
||||
<TextInput source="format" disabled />
|
||||
<TextInput source="maxBitRate" disabled />
|
||||
<TextInput source="username" disabled />
|
||||
<NumberField source="visitCount" disabled />
|
||||
<DateField source="lastVisitedAt" disabled showTime />
|
||||
<DateField source="createdAt" disabled showTime />
|
||||
|
||||
<Accordion>
|
||||
<AccordionSummary
|
||||
expandIcon={<ExpandMoreIcon />}
|
||||
aria-controls="share-urls-content"
|
||||
id="share-urls-header"
|
||||
>
|
||||
<Typography variant="body2" color="textSecondary">
|
||||
{translate('message.shareUrl')} & {translate('message.aplayerEmbedUrl')}
|
||||
</Typography>
|
||||
</AccordionSummary>
|
||||
<AccordionDetails>
|
||||
<Box mb={2}>
|
||||
<Typography variant="body2" color="textSecondary" gutterBottom>
|
||||
{translate('message.shareUrl')}
|
||||
@ -41,19 +64,8 @@ export const ShareEdit = (props) => {
|
||||
<Divider />
|
||||
</Box>
|
||||
<EmbedCodeField url={aplayerUrl} title={translate('message.navidromeMusicPlayer')} />
|
||||
<Box mb={3}>
|
||||
<Divider />
|
||||
</Box>
|
||||
<TextInput source="description" />
|
||||
{config.enableDownloads && <BooleanInput source="downloadable" />}
|
||||
<DateTimeInput source="expiresAt" />
|
||||
<TextInput source="contents" disabled />
|
||||
<TextInput source="format" disabled />
|
||||
<TextInput source="maxBitRate" disabled />
|
||||
<TextInput source="username" disabled />
|
||||
<NumberField source="visitCount" disabled />
|
||||
<DateField source="lastVisitedAt" disabled showTime />
|
||||
<DateField source="createdAt" disabled showTime />
|
||||
</AccordionDetails>
|
||||
</Accordion>
|
||||
</SimpleForm>
|
||||
</Edit>
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user