Add delete button to room detail page
This commit is contained in:
parent
1432724a64
commit
2e6988f090
@ -4,6 +4,7 @@ import {
|
|||||||
BooleanField,
|
BooleanField,
|
||||||
BulkDeleteWithConfirmButton,
|
BulkDeleteWithConfirmButton,
|
||||||
Datagrid,
|
Datagrid,
|
||||||
|
DeleteButton,
|
||||||
Filter,
|
Filter,
|
||||||
List,
|
List,
|
||||||
Pagination,
|
Pagination,
|
||||||
@ -15,6 +16,7 @@ import {
|
|||||||
Tab,
|
Tab,
|
||||||
TabbedShowLayout,
|
TabbedShowLayout,
|
||||||
TextField,
|
TextField,
|
||||||
|
TopToolbar,
|
||||||
useTranslate,
|
useTranslate,
|
||||||
} from "react-admin";
|
} from "react-admin";
|
||||||
import get from "lodash/get";
|
import get from "lodash/get";
|
||||||
@ -70,10 +72,16 @@ const RoomTitle = ({ record }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const RoomShowActions = ({ basePath, data, resource }) => (
|
||||||
|
<TopToolbar>
|
||||||
|
<DeleteButton basePath={basePath} record={data} resource={resource} />
|
||||||
|
</TopToolbar>
|
||||||
|
);
|
||||||
|
|
||||||
export const RoomShow = props => {
|
export const RoomShow = props => {
|
||||||
const translate = useTranslate();
|
const translate = useTranslate();
|
||||||
return (
|
return (
|
||||||
<Show {...props} title={<RoomTitle />}>
|
<Show {...props} actions={<RoomShowActions />} title={<RoomTitle />}>
|
||||||
<TabbedShowLayout>
|
<TabbedShowLayout>
|
||||||
<Tab label="synapseadmin.rooms.tabs.basic" icon={<ViewListIcon />}>
|
<Tab label="synapseadmin.rooms.tabs.basic" icon={<ViewListIcon />}>
|
||||||
<TextField source="room_id" />
|
<TextField source="room_id" />
|
||||||
|
Loading…
Reference in New Issue
Block a user