diff --git a/admin/src/admin.html b/admin/src/admin.html index 0e6bcc0439..9746e5c984 100644 --- a/admin/src/admin.html +++ b/admin/src/admin.html @@ -42,7 +42,7 @@ -
+
diff --git a/admin/src/admin.js b/admin/src/admin.js index f072227f70..c14180e34f 100644 --- a/admin/src/admin.js +++ b/admin/src/admin.js @@ -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"; @@ -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( { layout={layout} onEndSession={onEndSession} /> - , - document.getElementById("ui-root") + ); }; const HiddenAppBar = withStyles(props => { diff --git a/admin/src/react-components/accounts.js b/admin/src/react-components/accounts.js index 28017c1f0a..5911da95ca 100644 --- a/admin/src/react-components/accounts.js +++ b/admin/src/react-components/accounts.js @@ -29,7 +29,7 @@ import { SimpleForm, TextField, TextInput, - refreshView + // refreshView } from "react-admin"; const styles = { @@ -44,7 +44,7 @@ const AccountFilter = props => ( ); -export const AccountList = withStyles(connect(undefined, { refreshView })( +export const AccountList = withStyles(connect(undefined)( class AccountList extends Component { state = { emailSearch: "", @@ -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(); @@ -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 <> diff --git a/admin/src/react-components/admin-menu.js b/admin/src/react-components/admin-menu.js index 86e9dcc3e4..abd38a771e 100644 --- a/admin/src/react-components/admin-menu.js +++ b/admin/src/react-components/admin-menu.js @@ -92,129 +92,130 @@ function getResourceDisplayName(resource) { } } -class Menu extends Component { - const resourcesDefinitions = useResourceDefinitions(); - const resources = Object.keys(resourcesDefinitions).map(name => resourcesDefinitions[name]); - renderService(service) { - return ( - - - - - - - ); - } +const Menu = (props) => { + const resourcesDefinitions = useResourceDefinitions(); + const resources = Object.keys(resourcesDefinitions).map(name => resourcesDefinitions[name]); + + // TO DO - unused function to be removed + // const renderService = (service) => { + // return ( + // + // + // + // + // + // + // ); + // } - renderResource(resource) { + const renderResource = (resource) => { if (!resource.hasList) return null; const icon = resource.icon ? : ; return ( - {icon && {icon}} - + {icon && {icon}} + ); } - render() { if (configs.ITA_SERVER == "turkey") { return ( - - - + + + - + - + - - + + - + - + - + - {this.props.resources.map(this.renderResource.bind(this))} + {resources.map(renderResource.bind(this))} - - + + - + - + - + {hasPaidFeature() && ( <> {/* IMAGE SETTING */} - + - + {/* THEMES */} - + - + )} @@ -224,128 +225,128 @@ class Menu extends Component { ); } else { return ( - - - + + + - + - + - - + + - + - + - + - {this.props.resources.map(this.renderResource.bind(this))} + {resources.map(renderResource.bind(this))} - - + + - + - + - + - + - + {/* THEMES */} - + - + - + - + - + - + - + - + ); } - } + } export const AdminMenu = connect(mapStateToProps)(withStyles(Menu, styles));