diff --git a/frontend/src/components/BottomBar.js b/frontend/src/components/BottomBar.js index b6137cfa..670f5cd3 100644 --- a/frontend/src/components/BottomBar.js +++ b/frontend/src/components/BottomBar.js @@ -33,6 +33,7 @@ export default class BottomBar extends Component { today_avg_nonkyc_btc_premium: 0, today_total_volume: 0, lifetime_satoshis_settled: 0, + robosats_running_commit_hash: '000000000000000', }; this.getInfo(); } @@ -45,14 +46,13 @@ export default class BottomBar extends Component { this.setState(null) fetch('/api/info/') .then((response) => response.json()) - .then((data) => {console.log(data) & - this.setState(data) - }); + .then((data) => this.setState(data)); } handleClickOpenStatsForNerds = () => { this.setState({openStatsForNerds: true}); }; + handleClickCloseStatsForNerds = () => { this.setState({openStatsForNerds: false}); }; @@ -79,7 +79,7 @@ export default class BottomBar extends Component { {this.state.robosats_running_commit_hash} + + this.state.robosats_running_commit_hash}>{this.state.robosats_running_commit_hash.slice(0, 12)+"..."} diff --git a/frontend/src/components/Chat.js b/frontend/src/components/Chat.js index e9445554..16cf2c71 100644 --- a/frontend/src/components/Chat.js +++ b/frontend/src/components/Chat.js @@ -111,7 +111,7 @@ export default class Chat extends Component { - This chat has no memory. If you reload the page messages are lost. + This chat has no memory. If you leave and come back the messages are lost. ) } diff --git a/frontend/src/components/OrderPage.js b/frontend/src/components/OrderPage.js index 5d8f0603..ae75fd41 100644 --- a/frontend/src/components/OrderPage.js +++ b/frontend/src/components/OrderPage.js @@ -1,6 +1,9 @@ import React, { Component } from "react"; -import { Alert, Paper, CircularProgress, Button , Grid, Typography, List, ListItem, ListItemIcon, ListItemText, ListItemAvatar, Avatar, Divider, Box, LinearProgress, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle} from "@mui/material" +import PropTypes from 'prop-types'; +import { 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 TradeBox from "./TradeBox"; import getFlags from './getFlags' @@ -33,6 +36,39 @@ function pn(x) { return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); } +function TabPanel(props) { + const { children, value, index, ...other } = props; + return ( + + ); +} + +TabPanel.propTypes = { + children: PropTypes.node, + index: PropTypes.number.isRequired, + value: PropTypes.number.isRequired, +}; + +function a11yProps(index) { + return { + id: `simple-tab-${index}`, + 'aria-controls': `simple-tabpanel-${index}`, + }; +} + + export default class OrderPage extends Component { constructor(props) { super(props); @@ -342,11 +378,13 @@ export default class OrderPage extends Component { orderBox=()=>{ return( - + - - Order Details - + + + Order Details + + @@ -497,6 +535,47 @@ export default class OrderPage extends Component { ) } + doubleOrderPageDesktop=()=>{ + return( + + + {this.orderBox()} + + + + + + ) + } + + doubleOrderPagePhone=()=>{ + + const [value, setValue] = React.useState(1); + + const handleChange = (event, newValue) => { + setValue(newValue); + }; + + return( + + + + + + + + + + {this.orderBox()} + + + + + + + ); + } + orderDetailsPage (){ return( this.state.bad_request ? @@ -508,16 +587,19 @@ export default class OrderPage extends Component { : (this.state.is_participant ? - - - {this.orderBox()} - - - - - + <> + {/* Desktop View */} + + + + + {/* SmarPhone View */} + + + + : - + {this.orderBox()} ) ) diff --git a/frontend/src/components/TradeBox.js b/frontend/src/components/TradeBox.js index fac8cb17..247087bc 100644 --- a/frontend/src/components/TradeBox.js +++ b/frontend/src/components/TradeBox.js @@ -3,14 +3,12 @@ import { Paper, Rating, Button, Grid, Typography, TextField, List, ListItem, Lis import QRCode from "react-qr-code"; import Countdown from 'react-countdown'; import Chat from "./Chat" +import MediaQuery from 'react-responsive' // Icons -import SmartToyIcon from '@mui/icons-material/SmartToy'; import PercentIcon from '@mui/icons-material/Percent'; import BookIcon from '@mui/icons-material/Book'; - - function getCookie(name) { let cookieValue = null; if (document.cookie && document.cookie !== '') { @@ -265,14 +263,6 @@ export default class TradeBox extends Component { {/* TODO API sends data for a more confortable wait */} - - - - - - - - @@ -374,9 +364,12 @@ export default class TradeBox extends Component { label={"Payout Lightning Invoice"} required inputProps={{ - style: {textAlign:"center"} + style: {textAlign:"center"}, + maxHeight: 200, }} multiline + minRows={4} + maxRows={12} onChange={this.handleInputInvoiceChanged} /> @@ -750,9 +743,11 @@ handleRatingChange=(e)=>{ - - Contract Box - + + + Contract Box + + {/* Maker and taker Bond request */} {this.props.data.is_maker & this.props.data.status == 0 ? this.showQRInvoice() : ""}