import React, { Component } from "react"; import { Button , Grid, Typography, List, ListItem, ListItemText, ListItemAvatar, Avatar, Divider} from "@material-ui/core" import { Link } from 'react-router-dom' // pretty numbers function pn(x) { return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); } export default class OrderPage extends Component { constructor(props) { super(props); this.state = { isExplicit: false, }; this.orderId = this.props.match.params.orderId; this.getOrderDetails(); } getOrderDetails() { fetch('/api/order' + '?order_id=' + this.orderId) .then((response) => response.json()) .then((data) => { this.setState({ statusCode: data.status, statusText: data.status_message, type: data.type, currency: data.currency, currencyCode: (data.currency== 1 ) ? "USD": ((data.currency == 2 ) ? "EUR":"ETH"), amount: data.amount, paymentMethod: data.payment_method, isExplicit: data.is_explicit, premium: data.premium, satoshis: data.satoshis, makerId: data.maker, isParticipant: data.is_participant, makerNick: data.maker_nick, takerId: data.taker, takerNick: data.taker_nick, }); }); } render (){ return ( Robosat BTC {this.state.type ? " Sell " : " Buy "} Order {this.state.isExplicit ? : } {this.state.isParticipant ? <> { this.state.takerNick!='None' ? <> : ""} :"" } {this.state.isParticipant ? "" : } ); } }