Skip to content

Commit

Permalink
revert some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dklimpel committed Feb 3, 2023
1 parent 18fb8a7 commit 0f4677d
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 89 deletions.
137 changes: 58 additions & 79 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React from "react";
import { Admin, Resource, resolveBrowserLocale } from "react-admin";
import { StylesProvider, createGenerateClassName } from "@mui/styles";
import { createTheme, ThemeProvider } from "@mui/material/styles";
import polyglotI18nProvider from "ra-i18n-polyglot";
import authProvider from "./synapse/authProvider";
import dataProvider from "./synapse/dataProvider";
Expand Down Expand Up @@ -43,84 +41,65 @@ const i18nProvider = polyglotI18nProvider(
resolveBrowserLocale()
);

const theme = createTheme();
const generateClassName = createGenerateClassName({
disableGlobal: true,
seed: "mui-jss",
});

const App = () => (
<StylesProvider generateClassName={generateClassName}>
<ThemeProvider theme={theme}>
<Admin
disableTelemetry
loginPage={LoginPage}
authProvider={authProvider}
dataProvider={dataProvider}
i18nProvider={i18nProvider}
customRoutes={[
<Route
key="userImport"
path="/import_users"
component={ImportFeature}
/>,
]}
>
<Resource
name="users"
list={UserList}
create={UserCreate}
edit={UserEdit}
icon={UserIcon}
/>
<Resource
name="rooms"
list={RoomList}
show={RoomShow}
icon={RoomIcon}
/>
<Resource
name="user_media_statistics"
list={UserMediaStatsList}
icon={EqualizerIcon}
/>
<Resource
name="reports"
list={ReportList}
show={ReportShow}
icon={ReportIcon}
/>
<Resource
name="room_directory"
list={RoomDirectoryList}
icon={FolderSharedIcon}
/>
<Resource
name="destinations"
list={DestinationList}
show={DestinationShow}
icon={CloudQueueIcon}
/>
<Resource
name="registration_tokens"
list={RegistrationTokenList}
create={RegistrationTokenCreate}
edit={RegistrationTokenEdit}
icon={ConfirmationNumberIcon}
/>
<Resource name="connections" />
<Resource name="devices" />
<Resource name="room_members" />
<Resource name="users_media" />
<Resource name="joined_rooms" />
<Resource name="pushers" />
<Resource name="servernotices" />
<Resource name="forward_extremities" />
<Resource name="room_state" />
<Resource name="destination_rooms" />
</Admin>
</ThemeProvider>
</StylesProvider>
<Admin
disableTelemetry
loginPage={LoginPage}
authProvider={authProvider}
dataProvider={dataProvider}
i18nProvider={i18nProvider}
customRoutes={[
<Route key="userImport" path="/import_users" component={ImportFeature} />,
]}
>
<Resource
name="users"
list={UserList}
create={UserCreate}
edit={UserEdit}
icon={UserIcon}
/>
<Resource name="rooms" list={RoomList} show={RoomShow} icon={RoomIcon} />
<Resource
name="user_media_statistics"
list={UserMediaStatsList}
icon={EqualizerIcon}
/>
<Resource
name="reports"
list={ReportList}
show={ReportShow}
icon={ReportIcon}
/>
<Resource
name="room_directory"
list={RoomDirectoryList}
icon={FolderSharedIcon}
/>
<Resource
name="destinations"
list={DestinationList}
show={DestinationShow}
icon={CloudQueueIcon}
/>
<Resource
name="registration_tokens"
list={RegistrationTokenList}
create={RegistrationTokenCreate}
edit={RegistrationTokenEdit}
icon={ConfirmationNumberIcon}
/>
<Resource name="connections" />
<Resource name="devices" />
<Resource name="room_members" />
<Resource name="users_media" />
<Resource name="joined_rooms" />
<Resource name="pushers" />
<Resource name="servernotices" />
<Resource name="forward_extremities" />
<Resource name="room_state" />
<Resource name="destination_rooms" />
</Admin>
);

export default App;
2 changes: 1 addition & 1 deletion src/components/LoginPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
Select,
TextField,
} from "@mui/material";
import { makeStyles } from "@mui/styles";
import { makeStyles } from "@material-ui/core/styles";
import LockIcon from "@mui/icons-material/Lock";

const useStyles = makeStyles(theme => ({
Expand Down
10 changes: 3 additions & 7 deletions src/components/LoginPage.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@ import { TestContext } from "ra-test";
import { createTheme, ThemeProvider } from "@mui/material/styles";
import LoginPage from "./LoginPage";

const theme = createTheme();

describe("LoginForm", () => {
it("renders", () => {
render(
<ThemeProvider theme={theme}>
<TestContext>
<LoginPage />
</TestContext>
</ThemeProvider>
<TestContext>
<LoginPage />
</TestContext>
);
});
});
2 changes: 1 addition & 1 deletion src/components/devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
useRefresh,
} from "react-admin";
import ActionDelete from "@mui/icons-material/Delete";
import { makeStyles } from "@mui/styles";
import { makeStyles } from "@material-ui/core/styles";
import { alpha } from "@mui/material/styles";
import classnames from "classnames";

Expand Down
2 changes: 1 addition & 1 deletion src/components/media.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Fragment, useState } from "react";
import classnames from "classnames";
import { alpha } from "@mui/material/styles";
import { makeStyles } from "@mui/styles";
import { makeStyles } from "@material-ui/core/styles";
import {
BooleanInput,
Button,
Expand Down

0 comments on commit 0f4677d

Please sign in to comment.