Add option to allow share to be downloaded
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import {
|
||||
DateTimeInput,
|
||||
BooleanInput,
|
||||
Edit,
|
||||
NumberField,
|
||||
SimpleForm,
|
||||
@@ -19,6 +20,7 @@ export const ShareEdit = (props) => {
|
||||
{url}
|
||||
</Link>
|
||||
<TextInput source="description" />
|
||||
<BooleanInput source="downloadable" />
|
||||
<DateTimeInput source="expiresAt" />
|
||||
<TextInput source="contents" disabled />
|
||||
<TextInput source="format" disabled />
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import {
|
||||
Datagrid,
|
||||
FunctionField,
|
||||
BooleanField,
|
||||
List,
|
||||
NumberField,
|
||||
SimpleList,
|
||||
@@ -24,6 +25,7 @@ export const FormatInfo = ({ record, size }) => {
|
||||
|
||||
const ShareList = (props) => {
|
||||
const isXsmall = useMediaQuery((theme) => theme.breakpoints.down('xs'))
|
||||
const isDesktop = useMediaQuery((theme) => theme.breakpoints.up('lg'))
|
||||
const translate = useTranslate()
|
||||
const notify = useNotify()
|
||||
|
||||
@@ -101,10 +103,13 @@ const ShareList = (props) => {
|
||||
/>
|
||||
<TextField source="username" />
|
||||
<TextField source="description" />
|
||||
<TextField source="contents" />
|
||||
<FormatInfo source="format" />
|
||||
{isDesktop && <TextField source="contents" />}
|
||||
{isDesktop && <FormatInfo source="format" />}
|
||||
<BooleanField source="downloadable" />
|
||||
<NumberField source="visitCount" />
|
||||
<DateField source="lastVisitedAt" showTime sortByOrder={'DESC'} />
|
||||
{isDesktop && (
|
||||
<DateField source="lastVisitedAt" showTime sortByOrder={'DESC'} />
|
||||
)}
|
||||
<DateField source="expiresAt" showTime />
|
||||
</Datagrid>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user