Skip to content

Commit

Permalink
admin adjustments for react
Browse files Browse the repository at this point in the history
  • Loading branch information
nikk15 committed May 30, 2023
1 parent e73d3bf commit 7333c70
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 92 deletions.
2 changes: 1 addition & 1 deletion admin/src/admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</head>

<body>
<div id="ui-root"></div>
<div id="admin-ui-root"></div>
</body>

</html>
9 changes: 5 additions & 4 deletions admin/src/admin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable react/prop-types */
import "./webxr-bypass-hacks";
import configs from "./utils/configs";
import ReactDOM from "react-dom";
import { createRoot } from "react-dom/client";
import React, { Component } from "react";
import { Route } from "react-router-dom";
import PropTypes from "prop-types";
Expand Down Expand Up @@ -208,7 +208,9 @@ const mountUI = async (retPhxChannel, customRoutes, layout) => {
retPhxChannel.socket.disconnect();
};

ReactDOM.render(
const container = document.getElementById("admin-ui-root");
const root = createRoot(container)
root.render(
<IntlProvider locale={lang} messages={messages}>
<AdminUI
dataProvider={dataProvider}
Expand All @@ -217,8 +219,7 @@ const mountUI = async (retPhxChannel, customRoutes, layout) => {
layout={layout}
onEndSession={onEndSession}
/>
</IntlProvider>,
document.getElementById("ui-root")
</IntlProvider>
);
};
const HiddenAppBar = withStyles(props => {
Expand Down
8 changes: 4 additions & 4 deletions admin/src/react-components/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
SimpleForm,
TextField,
TextInput,
refreshView
// refreshView
} from "react-admin";

const styles = {
Expand All @@ -44,7 +44,7 @@ const AccountFilter = props => (
</Filter>
);

export const AccountList = withStyles(connect(undefined, { refreshView })(
export const AccountList = withStyles(connect(undefined)(
class AccountList extends Component {
state = {
emailSearch: "",
Expand Down Expand Up @@ -158,7 +158,7 @@ export const AccountList = withStyles(connect(undefined, { refreshView })(
createResults: results
});
}
this.props.refreshView();
// this.props.refreshView();
// Quickfix snackbar component does not always close
// Setting snackbar message to empty string closes
this.clearCreateStatusTimer();
Expand All @@ -170,7 +170,7 @@ export const AccountList = withStyles(connect(undefined, { refreshView })(
render() {
// refreshView() is only needed in onCreateAccounts()
// eslint-disable-next-line no-unused-vars
const { classes, refreshView, ...other } = this.props;
const { classes, ...other } = this.props;
return <>
<Card className={classes.searchCard}>
<CardContent>
Expand Down
Loading

0 comments on commit 7333c70

Please sign in to comment.