Replace Fragment with short form

https://legacy.reactjs.org/docs/fragments.html#short-syntax

Change-Id: Ib1af57fc5e87ded8c1fee38dcbd60fae8621cb07
This commit is contained in:
Manuel Stahl 2024-02-03 13:56:33 +01:00
parent 6363e3d32e
commit 51def5775d
6 changed files with 23 additions and 27 deletions

View File

@ -1,4 +1,4 @@
import React, { Fragment } from "react"; import React from "react";
import FolderSharedIcon from "@mui/icons-material/FolderShared"; import FolderSharedIcon from "@mui/icons-material/FolderShared";
import { import {
BooleanField, BooleanField,
@ -130,11 +130,7 @@ export const RoomDirectorySaveButton = () => {
); );
}; };
const RoomDirectoryBulkActionButtons = () => ( const RoomDirectoryBulkActionButtons = () => <RoomDirectoryBulkDeleteButton />;
<Fragment>
<RoomDirectoryBulkDeleteButton />
</Fragment>
);
const RoomDirectoryListActions = () => ( const RoomDirectoryListActions = () => (
<TopToolbar> <TopToolbar>

View File

@ -1,4 +1,4 @@
import React, { Fragment, useState } from "react"; import React, { useState } from "react";
import { import {
Button, Button,
SaveButton, SaveButton,
@ -93,7 +93,7 @@ export const ServerNoticeButton = () => {
}; };
return ( return (
<Fragment> <>
<Button <Button
label="resources.servernotices.send" label="resources.servernotices.send"
onClick={handleDialogOpen} onClick={handleDialogOpen}
@ -106,7 +106,7 @@ export const ServerNoticeButton = () => {
onClose={handleDialogClose} onClose={handleDialogClose}
onSend={handleSend} onSend={handleSend}
/> />
</Fragment> </>
); );
}; };
@ -138,7 +138,7 @@ export const ServerNoticeBulkButton = () => {
}; };
return ( return (
<Fragment> <>
<Button <Button
label="resources.servernotices.send" label="resources.servernotices.send"
onClick={handleDialogOpen} onClick={handleDialogOpen}
@ -151,6 +151,6 @@ export const ServerNoticeBulkButton = () => {
onClose={handleDialogClose} onClose={handleDialogClose}
onSend={handleSend} onSend={handleSend}
/> />
</Fragment> </>
); );
}; };

View File

@ -1,4 +1,4 @@
import React, { Fragment, useState } from "react"; import React, { useState } from "react";
import { import {
Button, Button,
useDelete, useDelete,
@ -41,7 +41,7 @@ export const DeviceRemoveButton = props => {
}; };
return ( return (
<Fragment> <>
<Button <Button
label="ra.action.remove" label="ra.action.remove"
onClick={handleClick} onClick={handleClick}
@ -70,6 +70,6 @@ export const DeviceRemoveButton = props => {
name: record.display_name ? record.display_name : record.id, name: record.display_name ? record.display_name : record.id,
}} }}
/> />
</Fragment> </>
); );
}; };

View File

@ -1,4 +1,4 @@
import React, { Fragment, useState } from "react"; import React, { useState } from "react";
import { import {
BooleanInput, BooleanInput,
Button, Button,
@ -119,7 +119,7 @@ export const DeleteMediaButton = props => {
}; };
return ( return (
<Fragment> <>
<Button <Button
label="resources.delete_media.action.send" label="resources.delete_media.action.send"
onClick={handleDialogOpen} onClick={handleDialogOpen}
@ -142,7 +142,7 @@ export const DeleteMediaButton = props => {
onClose={handleDialogClose} onClose={handleDialogClose}
onSend={handleSend} onSend={handleSend}
/> />
</Fragment> </>
); );
}; };
@ -193,7 +193,7 @@ export const ProtectMediaButton = props => {
Wrapping Tooltip with <div> Wrapping Tooltip with <div>
https://github.com/marmelab/react-admin/issues/4349#issuecomment-578594735 https://github.com/marmelab/react-admin/issues/4349#issuecomment-578594735
*/ */
<Fragment> <>
{record.quarantined_by && ( {record.quarantined_by && (
<Tooltip <Tooltip
title={translate("resources.protect_media.action.none", { title={translate("resources.protect_media.action.none", {
@ -238,7 +238,7 @@ export const ProtectMediaButton = props => {
</div> </div>
</Tooltip> </Tooltip>
)} )}
</Fragment> </>
); );
}; };
@ -285,7 +285,7 @@ export const QuarantineMediaButton = props => {
}; };
return ( return (
<Fragment> <>
{record.safe_from_quarantine && ( {record.safe_from_quarantine && (
<Tooltip <Tooltip
title={translate("resources.quarantine_media.action.none", { title={translate("resources.quarantine_media.action.none", {
@ -325,6 +325,6 @@ export const QuarantineMediaButton = props => {
</div> </div>
</Tooltip> </Tooltip>
)} )}
</Fragment> </>
); );
}; };

View File

@ -1,4 +1,4 @@
import React, { Fragment } from "react"; import React from "react";
import { import {
BooleanField, BooleanField,
BulkDeleteButton, BulkDeleteButton,
@ -279,7 +279,7 @@ export const RoomShow = props => {
}; };
const RoomBulkActionButtons = () => ( const RoomBulkActionButtons = () => (
<Fragment> <>
<RoomDirectoryBulkSaveButton /> <RoomDirectoryBulkSaveButton />
<RoomDirectoryBulkDeleteButton /> <RoomDirectoryBulkDeleteButton />
<BulkDeleteButton <BulkDeleteButton
@ -287,7 +287,7 @@ const RoomBulkActionButtons = () => (
confirmContent="resources.rooms.action.erase.content" confirmContent="resources.rooms.action.erase.content"
mutationMode="pessimistic" mutationMode="pessimistic"
/> />
</Fragment> </>
); );
const RoomFilter = props => ( const RoomFilter = props => (

View File

@ -1,4 +1,4 @@
import React, { cloneElement, Fragment } from "react"; import React, { cloneElement } from "react";
import AssignmentIndIcon from "@mui/icons-material/AssignmentInd"; import AssignmentIndIcon from "@mui/icons-material/AssignmentInd";
import ContactMailIcon from "@mui/icons-material/ContactMail"; import ContactMailIcon from "@mui/icons-material/ContactMail";
import DevicesIcon from "@mui/icons-material/Devices"; import DevicesIcon from "@mui/icons-material/Devices";
@ -138,7 +138,7 @@ const UserFilter = props => (
); );
const UserBulkActionButtons = props => ( const UserBulkActionButtons = props => (
<Fragment> <>
<ServerNoticeBulkButton {...props} /> <ServerNoticeBulkButton {...props} />
<BulkDeleteButton <BulkDeleteButton
{...props} {...props}
@ -146,7 +146,7 @@ const UserBulkActionButtons = props => (
confirmTitle="resources.users.helper.erase" confirmTitle="resources.users.helper.erase"
mutationMode="pessimistic" mutationMode="pessimistic"
/> />
</Fragment> </>
); );
export const UserList = props => { export const UserList = props => {