diff --git a/frontend/src/components/App.js b/frontend/src/components/App.js index 100c285b..8bd94ade 100644 --- a/frontend/src/components/App.js +++ b/frontend/src/components/App.js @@ -1,5 +1,5 @@ import React, { Component } from "react"; -import { render } from "react-dom"; +import ReactDOM from 'react-dom/client'; import HomePage from "./HomePage"; import { CssBaseline, IconButton} from "@mui/material"; import { ThemeProvider, createTheme } from '@mui/material/styles'; @@ -46,5 +46,8 @@ export default class App extends Component { } } -const appDiv = document.getElementById("app"); -render(, appDiv); \ No newline at end of file +const root = ReactDOM.createRoot( + document.getElementById("app") +); + +root.render(); diff --git a/frontend/src/components/AutocompletePayments.js b/frontend/src/components/AutocompletePayments.js index 9d12f06b..0ac6a6c9 100644 --- a/frontend/src/components/AutocompletePayments.js +++ b/frontend/src/components/AutocompletePayments.js @@ -44,7 +44,7 @@ const InputWrapper = styled('div')( display: flex; flex-wrap: wrap; overflow-y:auto; - + &:hover { border-color: ${theme.palette.mode === 'dark' ? (error? '#f44336':'#ffffff') : (error? '#dd0000' :'#2f2f2f')}; } @@ -233,7 +233,7 @@ export default function AutocompletePayments(props) { if(a || a == null){props.onAutocompleteChange(optionsToString(value))} return false }; - + return (
@@ -252,7 +252,7 @@ export default function AutocompletePayments(props) { {props.listHeaderText+" "} {groupedOptions.map((option, index) => ( -
  • +
  • : - ) } @@ -558,7 +558,7 @@ class OrderPage extends Component { - + {!this.state.type ? : }}> - + {this.state.type ? : }}> +
    @@ -32,9 +32,9 @@ class PaymentText extends Component { // Adds a Custom icon if there are words that do not match var chars_left = custom_methods.replace(' ','').replace(' ','').replace(' ','').replace(' ','').replace(' ','') - + if(chars_left.length > 0){rows.push( - +
    @@ -49,12 +49,12 @@ class PaymentText extends Component { } render() { - return ( + return (
    {this.parseText()}
    ) } -}; +} -export default withTranslation()(PaymentText); \ No newline at end of file +export default withTranslation()(PaymentText); diff --git a/frontend/src/components/TradeBox.js b/frontend/src/components/TradeBox.js index 8c495689..c4b0fa08 100644 --- a/frontend/src/components/TradeBox.js +++ b/frontend/src/components/TradeBox.js @@ -205,7 +205,7 @@ class TradeBox extends Component { - + @@ -283,7 +283,7 @@ class TradeBox extends Component { - + diff --git a/frontend/src/components/UserGenPage.js b/frontend/src/components/UserGenPage.js index f060cdac..1170b1fc 100644 --- a/frontend/src/components/UserGenPage.js +++ b/frontend/src/components/UserGenPage.js @@ -19,25 +19,28 @@ class UserGenPage extends Component { this.state = { openInfo: false, tokenHasChanged: false, + token: "" }; this.refCode = this.props.match.params.refCode; + } + componentDidMount() { // Checks in parent HomePage if there is already a nick and token // Displays the existing one if (this.props.nickname != null){ - this.state = { + this.setState({ nickname: this.props.nickname, token: this.props.token? this.props.token : null, avatar_url: '/static/assets/avatars/' + this.props.nickname + '.png', loadingRobot: false - } + }); } else{ var newToken = this.genBase62Token(36) - this.state = { + this.setState({ token: newToken - }; + }); this.getGeneratedUser(newToken); } } @@ -78,12 +81,12 @@ class UserGenPage extends Component { token: token, avatarLoaded: false, })) & writeCookie("robot_token",token)) - & + & // If the robot has been found (recovered) we assume the token is backed up (data.found ? this.props.setAppState({copiedToken:true}) : null) }); } - + delGeneratedUser() { const requestOptions = { method: 'DELETE', @@ -127,7 +130,7 @@ class UserGenPage extends Component { InfoDialog =() =>{ return( - +

    @@ -187,7 +190,7 @@ class UserGenPage extends Component { + (navigator.clipboard.writeText(this.state.token) & this.props.setAppState({copiedToken:true}))}> , endAdornment: - + , }} @@ -220,7 +223,7 @@ class UserGenPage extends Component { {t("Generate Robot")} : - +