Add option to allow share to be downloaded

This commit is contained in:
Deluan
2023-03-10 23:01:03 -05:00
committed by Deluan Quintão
parent a22eef39f7
commit a7d3e6e1f1
13 changed files with 70 additions and 7 deletions
+2
View File
@@ -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 />
+8 -3
View File
@@ -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>
)}