diff --git a/frontend/src/components/OrderPage.js b/frontend/src/components/OrderPage.js index 16a9e58e..727d013f 100644 --- a/frontend/src/components/OrderPage.js +++ b/frontend/src/components/OrderPage.js @@ -1,9 +1,10 @@ import React, { Component } from "react"; import { withTranslation} from "react-i18next"; -import {TextField,Chip, Tooltip, Badge, Tab, Tabs, Alert, Paper, CircularProgress, Button , Grid, Typography, List, ListItem, ListItemIcon, ListItemText, ListItemAvatar, Avatar, Divider, Box, LinearProgress, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle} from "@mui/material" +import {TextField,Chip, Tooltip, IconButton, Badge, Tab, Tabs, Alert, Paper, CircularProgress, Button , Grid, Typography, List, ListItem, ListItemIcon, ListItemText, ListItemAvatar, Avatar, Divider, Box, LinearProgress, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle} from "@mui/material" import Countdown, { zeroPad, calcTimeDelta } from 'react-countdown'; import MediaQuery from 'react-responsive' import currencyDict from '../../static/assets/currencies.json'; +import { Link as LinkRouter } from 'react-router-dom' import PaymentText from './PaymentText' import TradeBox from "./TradeBox"; @@ -18,6 +19,7 @@ import PaymentsIcon from '@mui/icons-material/Payments'; import ArticleIcon from '@mui/icons-material/Article'; import SendReceiveIcon from "./icons/SendReceiveIcon"; import HourglassTopIcon from '@mui/icons-material/HourglassTop'; +import ContentCopy from "@mui/icons-material/ContentCopy"; import { getCookie } from "../utils/cookies"; import { pn } from "../utils/prettyNumbers"; @@ -176,8 +178,9 @@ class OrderPage extends Component { const { t } = this.props; if(this.state.has_range){ return( - + +
@@ -212,7 +215,7 @@ class OrderPage extends Component {
this.state.max_amount || this.state.takeAmount == "" || this.state.takeAmount == null) ? 'none':''}}> @@ -223,10 +226,11 @@ class OrderPage extends Component { return( <> - + + ) } @@ -371,6 +375,74 @@ class OrderPage extends Component { ) } + + StoreTokenDialog = () =>{ + const { t } = this.props; + + // If there is a robot cookie, prompt user to store it + // Else, prompt user to generate a robot + if (getCookie("robot_token")){ + return( + this.setState({openStoreToken:false})} + > + + {t("Store your robot token")} + + + + {t("You might need to recover your robot avatar in the future: store it safely. You can simply copy it into another application.")} + +
+ + + (navigator.clipboard.writeText(getCookie("robot_token")) & this.props.setAppState({copiedToken:true}))}> + + + , + }} + /> + +
+ + + + +
+ ) + }else{ + return( + this.setState({openStoreToken:false})} + > + + {t("You do not have a robot avatar")} + + + + {t("You need to generate a robot avatar in order to become an order maker")} + + + + + + + + ) + } +} + handleClickConfirmCollaborativeCancelButton=()=>{ const requestOptions = { method: 'POST',