@@ -608,7 +635,7 @@ const FilePicker = () => {
);
- let startImportCard =
+ const startImportCard =
!values || values.length === 0 || importResults ? undefined : (
{
}
label={translate("import_users.cards.startImport.simulate_only")}
/>
-
);
- let allCards = [];
+ const allCards: JSX.Element[] = [];
if (uploadCard) allCards.push(uploadCard);
if (errorCards) allCards.push(errorCards);
if (conflictCards) allCards.push(conflictCards);
@@ -644,7 +667,7 @@ const FilePicker = () => {
if (startImportCard) allCards.push(startImportCard);
if (resultsCard) allCards.push(resultsCard);
- let cardContainer =
{allCards};
+ const cardContainer =
{allCards};
return [
,
diff --git a/src/components/LoginPage.test.jsx b/src/components/LoginPage.test.tsx
similarity index 99%
rename from src/components/LoginPage.test.jsx
rename to src/components/LoginPage.test.tsx
index c07a68e..25580c4 100644
--- a/src/components/LoginPage.test.jsx
+++ b/src/components/LoginPage.test.tsx
@@ -1,4 +1,3 @@
-import React from "react";
import { render, screen } from "@testing-library/react";
import { AdminContext } from "react-admin";
import polyglotI18nProvider from "ra-i18n-polyglot";
diff --git a/src/components/LoginPage.jsx b/src/components/LoginPage.tsx
similarity index 98%
rename from src/components/LoginPage.jsx
rename to src/components/LoginPage.tsx
index 02870a8..f832dfc 100644
--- a/src/components/LoginPage.jsx
+++ b/src/components/LoginPage.tsx
@@ -1,4 +1,4 @@
-import React, { useState, useEffect } from "react";
+import { useState, useEffect } from "react";
import {
Form,
FormDataConsumer,
@@ -183,7 +183,7 @@ const LoginPage = () => {
const [serverVersion, setServerVersion] = useState("");
const [matrixVersions, setMatrixVersions] = useState("");
- const handleUsernameChange = _ => {
+ const handleUsernameChange = () => {
if (formData.base_url || allowSingleBaseUrl) return;
// check if username is a full qualified userId then set base_url accordingly
const domain = splitMxid(formData.username)?.domain;
@@ -238,7 +238,7 @@ const LoginPage = () => {
{
{
{
const registrationTokenFilters = [];
-export const RegistrationTokenList = props => (
+export const RegistrationTokenList = (props: ListProps) => (
(
);
-export const RegistrationTokenCreate = props => (
+export const RegistrationTokenCreate = (props: CreateProps) => (
(
);
-export const RegistrationTokenEdit = props => (
+export const RegistrationTokenEdit = (props: EditProps) => (
@@ -131,7 +134,7 @@ export const RegistrationTokenEdit = props => (
);
-const resource = {
+const resource: ResourceProps = {
name: "registration_tokens",
icon: RegistrationTokenIcon,
list: RegistrationTokenList,
diff --git a/src/components/RoomDirectory.jsx b/src/components/RoomDirectory.tsx
similarity index 90%
rename from src/components/RoomDirectory.jsx
rename to src/components/RoomDirectory.tsx
index 2b338a6..f5fb442 100644
--- a/src/components/RoomDirectory.jsx
+++ b/src/components/RoomDirectory.tsx
@@ -1,14 +1,17 @@
-import React from "react";
import {
BooleanField,
BulkDeleteButton,
+ BulkDeleteButtonProps,
Button,
+ ButtonProps,
DatagridConfigurable,
+ DeleteButtonProps,
ExportButton,
DeleteButton,
List,
NumberField,
Pagination,
+ ResourceProps,
SelectColumnsButton,
TextField,
TopToolbar,
@@ -29,7 +32,7 @@ const RoomDirectoryPagination = () => (
);
-export const RoomDirectoryUnpublishButton = props => {
+export const RoomDirectoryUnpublishButton = (props: DeleteButtonProps) => {
const translate = useTranslate();
return (
@@ -50,7 +53,9 @@ export const RoomDirectoryUnpublishButton = props => {
);
};
-export const RoomDirectoryBulkUnpublishButton = props => (
+export const RoomDirectoryBulkUnpublishButton = (
+ props: BulkDeleteButtonProps
+) => (
(
/>
);
-export const RoomDirectoryBulkPublishButton = props => {
+export const RoomDirectoryBulkPublishButton = (props: ButtonProps) => {
const { selectedIds } = useListContext();
const notify = useNotify();
const refresh = useRefresh();
@@ -99,7 +104,7 @@ export const RoomDirectoryBulkPublishButton = props => {
);
};
-export const RoomDirectoryPublishButton = props => {
+export const RoomDirectoryPublishButton = (props: ButtonProps) => {
const record = useRecordContext();
const notify = useNotify();
const refresh = useRefresh();
@@ -148,7 +153,7 @@ export const RoomDirectoryList = () => (
actions={}
>
"/rooms/" + id + "/show"}
+ rowClick={id => "/rooms/" + id + "/show"}
bulkActionButtons={}
omit={["room_id", "canonical_alias", "topic"]}
>
@@ -197,7 +202,7 @@ export const RoomDirectoryList = () => (
);
-const resource = {
+const resource: ResourceProps = {
name: "room_directory",
icon: RoomDirectoryIcon,
list: RoomDirectoryList,
diff --git a/src/components/ServerNotices.jsx b/src/components/ServerNotices.tsx
similarity index 89%
rename from src/components/ServerNotices.jsx
rename to src/components/ServerNotices.tsx
index ab15825..9a89d68 100644
--- a/src/components/ServerNotices.jsx
+++ b/src/components/ServerNotices.tsx
@@ -1,10 +1,12 @@
-import React, { useState } from "react";
+import { useState } from "react";
import {
Button,
+ RaRecord,
SaveButton,
SimpleForm,
TextInput,
Toolbar,
+ ToolbarProps,
required,
useCreate,
useDataProvider,
@@ -24,10 +26,12 @@ import {
DialogTitle,
} from "@mui/material";
-const ServerNoticeDialog = ({ open, loading, onClose, onSubmit }) => {
+const ServerNoticeDialog = ({ open, onClose, onSubmit }) => {
const translate = useTranslate();
- const ServerNoticeToolbar = props => (
+ const ServerNoticeToolbar = (
+ props: ToolbarProps & { pristine?: boolean }
+ ) => (
{
);
return (
-
@@ -223,7 +229,7 @@ export const ProtectMediaButton = () => {
arrow
>