mirror of
https://github.com/RoboSats/robosats.git
synced 2024-12-13 19:06:26 +00:00
Fix undefined imports
This commit is contained in:
parent
d5c93e5a30
commit
1145812e2e
17834
frontend/package-lock.json
generated
17834
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -56,7 +56,7 @@
|
|||||||
"openpgp": "^5.2.1",
|
"openpgp": "^5.2.1",
|
||||||
"react": "^18.0.0",
|
"react": "^18.0.0",
|
||||||
"react-countdown": "^2.3.2",
|
"react-countdown": "^2.3.2",
|
||||||
"react-dom": "^18.0.0",
|
"react-dom": "^18.1.0",
|
||||||
"react-i18next": "^11.16.2",
|
"react-i18next": "^11.16.2",
|
||||||
"react-native": "^0.66.4",
|
"react-native": "^0.66.4",
|
||||||
"react-native-svg": "^12.3.0",
|
"react-native-svg": "^12.3.0",
|
||||||
|
@ -157,7 +157,7 @@ class BookPage extends Component {
|
|||||||
NoRowsOverlay: () => (
|
NoRowsOverlay: () => (
|
||||||
<Stack height="100%" alignItems="center" justifyContent="center">
|
<Stack height="100%" alignItems="center" justifyContent="center">
|
||||||
<div style={{ height:"220px"}}/>
|
<div style={{ height:"220px"}}/>
|
||||||
<this.NoOrdersFound/>
|
{this.NoOrdersFound()}
|
||||||
</Stack>
|
</Stack>
|
||||||
),
|
),
|
||||||
NoResultsOverlay: () => (
|
NoResultsOverlay: () => (
|
||||||
@ -258,7 +258,7 @@ class BookPage extends Component {
|
|||||||
NoRowsOverlay: () => (
|
NoRowsOverlay: () => (
|
||||||
<Stack height="100%" alignItems="center" justifyContent="center">
|
<Stack height="100%" alignItems="center" justifyContent="center">
|
||||||
<div style={{ height:"220px"}}/>
|
<div style={{ height:"220px"}}/>
|
||||||
<this.NoOrdersFound/>
|
{this.NoOrdersFound()}
|
||||||
</Stack>
|
</Stack>
|
||||||
),
|
),
|
||||||
NoResultsOverlay: () => (
|
NoResultsOverlay: () => (
|
||||||
@ -426,14 +426,14 @@ class BookPage extends Component {
|
|||||||
{/* Desktop Book */}
|
{/* Desktop Book */}
|
||||||
<MediaQuery minWidth={930}>
|
<MediaQuery minWidth={930}>
|
||||||
<Paper elevation={0} style={{width: 925, maxHeight: 500, overflow: 'auto'}}>
|
<Paper elevation={0} style={{width: 925, maxHeight: 500, overflow: 'auto'}}>
|
||||||
<this.bookListTableDesktop/>
|
{this.bookListTableDesktop()}
|
||||||
</Paper>
|
</Paper>
|
||||||
</MediaQuery>
|
</MediaQuery>
|
||||||
|
|
||||||
{/* Smartphone Book */}
|
{/* Smartphone Book */}
|
||||||
<MediaQuery maxWidth={929}>
|
<MediaQuery maxWidth={929}>
|
||||||
<Paper elevation={0} style={{width: 395, maxHeight: 450, overflow: 'auto'}}>
|
<Paper elevation={0} style={{width: 395, maxHeight: 450, overflow: 'auto'}}>
|
||||||
<this.bookListTablePhone/>
|
{this.bookListTablePhone()}
|
||||||
</Paper>
|
</Paper>
|
||||||
</MediaQuery>
|
</MediaQuery>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
@ -447,10 +447,10 @@ bottomBarDesktop =()=>{
|
|||||||
const { t } = this.props;
|
const { t } = this.props;
|
||||||
return(
|
return(
|
||||||
<Paper elevation={6} style={{height:40}}>
|
<Paper elevation={6} style={{height:40}}>
|
||||||
<this.StatsDialog/>
|
{this.StatsDialog()}
|
||||||
<this.CommunityDialog/>
|
{this.CommunityDialog()}
|
||||||
<this.dialogProfile/>
|
{this.dialogProfile()}
|
||||||
<this.exchangeSummaryDialog/>
|
{this.exchangeSummaryDialog()}
|
||||||
<Grid container xs={12}>
|
<Grid container xs={12}>
|
||||||
|
|
||||||
<Grid item xs={1.9}>
|
<Grid item xs={1.9}>
|
||||||
@ -544,7 +544,7 @@ bottomBarDesktop =()=>{
|
|||||||
|
|
||||||
<Grid container item xs={1}>
|
<Grid container item xs={1}>
|
||||||
<Grid item xs={6}>
|
<Grid item xs={6}>
|
||||||
<this.LangSelect/>
|
{this.LangSelect()}
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={3}>
|
<Grid item xs={3}>
|
||||||
<Tooltip enterTouchDelay={250} title={t("Show community and support links")}>
|
<Tooltip enterTouchDelay={250} title={t("Show community and support links")}>
|
||||||
@ -711,10 +711,10 @@ bottomBarPhone =()=>{
|
|||||||
const { t } = this.props;
|
const { t } = this.props;
|
||||||
return(
|
return(
|
||||||
<Paper elevation={6} style={{height:40}}>
|
<Paper elevation={6} style={{height:40}}>
|
||||||
<this.StatsDialog/>
|
{this.StatsDialog()}
|
||||||
<this.CommunityDialog/>
|
{this.CommunityDialog()}
|
||||||
<this.exchangeSummaryDialog/>
|
{this.exchangeSummaryDialog()}
|
||||||
<this.dialogProfile/>
|
{this.dialogProfile()}
|
||||||
<Grid container xs={12}>
|
<Grid container xs={12}>
|
||||||
|
|
||||||
<Grid item xs={1.6}>
|
<Grid item xs={1.6}>
|
||||||
@ -781,7 +781,7 @@ bottomBarPhone =()=>{
|
|||||||
|
|
||||||
<Grid container item xs={3.8}>
|
<Grid container item xs={3.8}>
|
||||||
<Grid item xs={6}>
|
<Grid item xs={6}>
|
||||||
<this.LangSelect/>
|
{this.LangSelect()}
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={3}>
|
<Grid item xs={3}>
|
||||||
<Tooltip enterTouchDelay={250} title={t("Show community and support links")}>
|
<Tooltip enterTouchDelay={250} title={t("Show community and support links")}>
|
||||||
@ -813,11 +813,11 @@ bottomBarPhone =()=>{
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<MediaQuery minWidth={1200}>
|
<MediaQuery minWidth={1200}>
|
||||||
<this.bottomBarDesktop/>
|
{this.bottomBarDesktop()}
|
||||||
</MediaQuery>
|
</MediaQuery>
|
||||||
|
|
||||||
<MediaQuery maxWidth={1199}>
|
<MediaQuery maxWidth={1199}>
|
||||||
<this.bottomBarPhone/>
|
{this.bottomBarPhone()}
|
||||||
</MediaQuery>
|
</MediaQuery>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
26
frontend/src/components/LinearDeterminate.js
Normal file
26
frontend/src/components/LinearDeterminate.js
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import React, { useState, useEffect } from "react";
|
||||||
|
import { Box, LinearProgress } from "@mui/material"
|
||||||
|
import { calcTimeDelta } from 'react-countdown';
|
||||||
|
|
||||||
|
export default function LinearDeterminate(props) {
|
||||||
|
const [progress, setProgress] = useState(0);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const timer = setInterval(() => {
|
||||||
|
setProgress((oldProgress) => {
|
||||||
|
var left = calcTimeDelta( new Date(props.expires_at)).total /1000;
|
||||||
|
return (left / props.total_secs_exp) * 100;
|
||||||
|
});
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
clearInterval(timer);
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Box sx={{ width: '100%' }}>
|
||||||
|
<LinearProgress variant="determinate" value={progress} />
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
}
|
@ -38,6 +38,7 @@ class MakerPage extends Component {
|
|||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state={
|
this.state={
|
||||||
|
tabValue: 0,
|
||||||
is_explicit: false,
|
is_explicit: false,
|
||||||
type: 0,
|
type: 0,
|
||||||
currency: this.defaultCurrency,
|
currency: this.defaultCurrency,
|
||||||
@ -552,7 +553,7 @@ class MakerPage extends Component {
|
|||||||
<Tooltip enterTouchDelay={0} placement="top" align="center" title={t("Let the taker chose an amount within the range")}>
|
<Tooltip enterTouchDelay={0} placement="top" align="center" title={t("Let the taker chose an amount within the range")}>
|
||||||
<div align="center" style={{display:'flex',alignItems:'center', flexWrap:'wrap'}}>
|
<div align="center" style={{display:'flex',alignItems:'center', flexWrap:'wrap'}}>
|
||||||
<Checkbox onChange={(e)=>this.setState({enableAmountRange:e.target.checked, is_explicit: false})}/>
|
<Checkbox onChange={(e)=>this.setState({enableAmountRange:e.target.checked, is_explicit: false})}/>
|
||||||
{this.state.enableAmountRange & this.state.minAmount != null? <this.rangeText/> : t("Enable Amount Range")}
|
{this.state.enableAmountRange & this.state.minAmount != null? this.rangeText() : t("Enable Amount Range")}
|
||||||
</div>
|
</div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</FormHelperText>
|
</FormHelperText>
|
||||||
@ -560,30 +561,30 @@ class MakerPage extends Component {
|
|||||||
<LinearProgress />
|
<LinearProgress />
|
||||||
</div>
|
</div>
|
||||||
<div style={{ display: this.state.loadingLimits == false ? '':'none'}}>
|
<div style={{ display: this.state.loadingLimits == false ? '':'none'}}>
|
||||||
<this.RangeSlider
|
{/* {this.RangeSlider(
|
||||||
disableSwap={true}
|
disableSwap=true,
|
||||||
sx={{width:200, align:"center"}}
|
sx={width:200, align:"center"},
|
||||||
disabled={!this.state.enableAmountRange || this.state.loadingLimits}
|
disabled=(!this.state.enableAmountRange || this.state.loadingLimits),
|
||||||
value={[this.state.minAmount, this.state.maxAmount]}
|
value=([this.state.minAmount, this.state.maxAmount]),
|
||||||
step={(this.getMaxAmount()-this.getMinAmount())/5000}
|
step=((this.getMaxAmount()-this.getMinAmount())/5000),
|
||||||
valueLabelDisplay="auto"
|
valueLabelDisplay="auto",
|
||||||
components={{ Thumb: this.RangeThumbComponent }}
|
components=({ Thumb: this.RangeThumbComponent }),
|
||||||
valueLabelFormat={(x) => (parseFloat(Number(x).toPrecision(x < 100 ? 2 : 3))+" "+this.state.currencyCode)}
|
valueLabelFormat=((x) => (parseFloat(Number(x).toPrecision(x < 100 ? 2 : 3))+" "+this.state.currencyCode)),
|
||||||
marks={this.state.limits == null?
|
marks=(this.state.limits == null?
|
||||||
null
|
null
|
||||||
:
|
:
|
||||||
[{value: this.getMinAmount(),label: this.getMinAmount()+" "+ this.state.currencyCode},
|
[{value: this.getMinAmount(),label: this.getMinAmount()+" "+ this.state.currencyCode},
|
||||||
{value: this.getMaxAmount(),label: this.getMaxAmount()+" "+this.state.currencyCode}]}
|
{value: this.getMaxAmount(),label: this.getMaxAmount()+" "+this.state.currencyCode}]),
|
||||||
min={this.getMinAmount()}
|
min=this.getMinAmount(),
|
||||||
max={this.getMaxAmount()}
|
max=this.getMaxAmount(),
|
||||||
onChange={this.handleRangeAmountChange}
|
onChange=this.handleRangeAmountChange)
|
||||||
/>
|
} */}
|
||||||
</div>
|
</div>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid item xs={12} align="center">
|
<Grid item xs={12} align="center">
|
||||||
<Accordion elevation={0} sx={{width:'280px', position:'relative', left:'-12px'}}>
|
<Accordion elevation={0} sx={{width:'280px', position:'relative', left:'-8px'}}>
|
||||||
<AccordionSummary expandIcon={<ExpandMoreIcon color="primary"/>}>
|
<AccordionSummary expandIcon={<ExpandMoreIcon color="primary"/>}>
|
||||||
<Typography sx={{flexGrow: 1, textAlign: "center"}} color="text.secondary">{t("Expiry Timers")}</Typography>
|
<Typography sx={{flexGrow: 1, textAlign: "center"}} color="text.secondary">{t("Expiry Timers")}</Typography>
|
||||||
</AccordionSummary>
|
</AccordionSummary>
|
||||||
@ -766,32 +767,27 @@ class MakerPage extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
makeOrderBox=()=>{
|
makeOrderBox=()=>{
|
||||||
const [value, setValue] = React.useState(this.state.showAdvanced);
|
|
||||||
const { t } = this.props;
|
const { t } = this.props;
|
||||||
const handleChange = (event, newValue) => {
|
|
||||||
this.setState({showAdvanced:newValue})
|
|
||||||
setValue(newValue);
|
|
||||||
};
|
|
||||||
return(
|
return(
|
||||||
<Box sx={{width: this.state.showAdvanced? '270px':'252px'}}>
|
<Box sx={{width: this.state.tabValue==1? '270px':'252px'}}>
|
||||||
<Box sx={{ borderBottom: 1, borderColor: 'divider', position:'relative',left:'5px'}}>
|
<Box sx={{ borderBottom: 1, borderColor: 'divider', position:'relative',left:'5px'}}>
|
||||||
<Tabs value={value? value:0} onChange={handleChange} variant="fullWidth" >
|
<Tabs value={this.state.tabValue} variant="fullWidth" >
|
||||||
<Tab label={t("Order")} {...this.a11yProps(0)} />
|
<Tab label={t("Order")} {...this.a11yProps(0)} onClick={() => this.setState({tabValue:0})}/>
|
||||||
<Tab label={t("Customize")} {...this.a11yProps(1)} />
|
<Tab label={t("Customize")} {...this.a11yProps(1)} onClick={() => this.setState({tabValue:1})}/>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<Grid item xs={12} align="center">
|
<Grid item xs={12} align="center">
|
||||||
<div style={{ display: this.state.showAdvanced == false ? '':'none'}}>
|
<div style={{ display: this.state.tabValue == 0 ? '':'none'}}>
|
||||||
<this.StandardMakerOptions/>
|
{this.StandardMakerOptions()}
|
||||||
</div>
|
</div>
|
||||||
<div style={{ display: this.state.showAdvanced == true ? '':'none'}}>
|
<div style={{ display: this.state.tabValue == 1 ? '':'none'}}>
|
||||||
<this.AdvancedMakerOptions/>
|
{this.AdvancedMakerOptions()}
|
||||||
</div>
|
</div>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Box>
|
</Box>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { t } = this.props;
|
const { t } = this.props;
|
||||||
return (
|
return (
|
||||||
@ -804,7 +800,7 @@ class MakerPage extends Component {
|
|||||||
<this.StoreTokenDialog/>
|
<this.StoreTokenDialog/>
|
||||||
|
|
||||||
<Grid item xs={12} align="center">
|
<Grid item xs={12} align="center">
|
||||||
<this.makeOrderBox/>
|
{this.makeOrderBox()}
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid item xs={12} align="center">
|
<Grid item xs={12} align="center">
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import React, { Component } from "react";
|
import React, { Component } from "react";
|
||||||
import { withTranslation} from "react-i18next";
|
import { withTranslation} from "react-i18next";
|
||||||
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 {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 Countdown, { zeroPad } from 'react-countdown';
|
||||||
|
import LinearDeterminate from './LinearDeterminate';
|
||||||
import MediaQuery from 'react-responsive'
|
import MediaQuery from 'react-responsive'
|
||||||
import currencyDict from '../../static/assets/currencies.json';
|
import currencyDict from '../../static/assets/currencies.json';
|
||||||
import { Link as LinkRouter } from 'react-router-dom'
|
import { Link as LinkRouter } from 'react-router-dom'
|
||||||
@ -35,7 +36,7 @@ class OrderPage extends Component {
|
|||||||
openCancel: false,
|
openCancel: false,
|
||||||
openCollaborativeCancel: false,
|
openCollaborativeCancel: false,
|
||||||
openInactiveMaker: false,
|
openInactiveMaker: false,
|
||||||
showContractBox: 1,
|
tabValue: 1,
|
||||||
orderId: this.props.match.params.orderId,
|
orderId: this.props.match.params.orderId,
|
||||||
};
|
};
|
||||||
this.getOrderDetails(this.props.match.params.orderId);
|
this.getOrderDetails(this.props.match.params.orderId);
|
||||||
@ -237,10 +238,10 @@ class OrderPage extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
countdownTakeOrderRenderer = ({ seconds, completed }) => {
|
countdownTakeOrderRenderer = ({ seconds, completed }) => {
|
||||||
if(isNaN(seconds)){return (<this.takeOrderButton/>)}
|
if(isNaN(seconds)){return (this.takeOrderButton())}
|
||||||
if (completed) {
|
if (completed) {
|
||||||
// Render a completed state
|
// Render a completed state
|
||||||
return ( <this.takeOrderButton/>);
|
return this.takeOrderButton();
|
||||||
} else{
|
} else{
|
||||||
return(
|
return(
|
||||||
<Tooltip enterTouchDelay={0} title={t("Wait until you can take an order")}><div>
|
<Tooltip enterTouchDelay={0} title={t("Wait until you can take an order")}><div>
|
||||||
@ -249,29 +250,6 @@ class OrderPage extends Component {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
LinearDeterminate =()=> {
|
|
||||||
const [progress, setProgress] = React.useState(0);
|
|
||||||
|
|
||||||
React.useEffect(() => {
|
|
||||||
const timer = setInterval(() => {
|
|
||||||
setProgress((oldProgress) => {
|
|
||||||
var left = calcTimeDelta( new Date(this.state.expires_at)).total /1000;
|
|
||||||
return (left / this.state.total_secs_exp) * 100;
|
|
||||||
});
|
|
||||||
}, 1000);
|
|
||||||
|
|
||||||
return () => {
|
|
||||||
clearInterval(timer);
|
|
||||||
};
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Box sx={{ width: '100%' }}>
|
|
||||||
<LinearProgress variant="determinate" value={progress} />
|
|
||||||
</Box>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
takeOrder=()=>{
|
takeOrder=()=>{
|
||||||
this.setState({loading:true})
|
this.setState({loading:true})
|
||||||
const requestOptions = {
|
const requestOptions = {
|
||||||
@ -517,7 +495,7 @@ class OrderPage extends Component {
|
|||||||
return(
|
return(
|
||||||
<div id="openDialogCancelButton">
|
<div id="openDialogCancelButton">
|
||||||
<Grid item xs={12} align="center">
|
<Grid item xs={12} align="center">
|
||||||
<this.CancelDialog/>
|
{this.CancelDialog()}
|
||||||
<Button variant='contained' color='secondary' onClick={this.handleClickOpenConfirmCancelDialog}>{t("Cancel")}</Button>
|
<Button variant='contained' color='secondary' onClick={this.handleClickOpenConfirmCancelDialog}>{t("Cancel")}</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
</div>
|
</div>
|
||||||
@ -528,7 +506,7 @@ class OrderPage extends Component {
|
|||||||
if ([8,9].includes(this.state.status)){
|
if ([8,9].includes(this.state.status)){
|
||||||
return(
|
return(
|
||||||
<Grid item xs={12} align="center">
|
<Grid item xs={12} align="center">
|
||||||
<this.CollaborativeCancelDialog/>
|
{this.CollaborativeCancelDialog()}
|
||||||
<Button variant='contained' color='secondary' onClick={this.handleClickOpenCollaborativeCancelDialog}>{t("Collaborative Cancel")}</Button>
|
<Button variant='contained' color='secondary' onClick={this.handleClickOpenCollaborativeCancelDialog}>{t("Collaborative Cancel")}</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
)}
|
)}
|
||||||
@ -682,7 +660,7 @@ class OrderPage extends Component {
|
|||||||
<Countdown date={new Date(this.state.expires_at)} renderer={this.countdownRenderer} />
|
<Countdown date={new Date(this.state.expires_at)} renderer={this.countdownRenderer} />
|
||||||
</ListItemText>
|
</ListItemText>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
<this.LinearDeterminate />
|
<LinearDeterminate total_secs_exp={this.state.total_secs_exp} expires_at={this.state.expires_at}/>
|
||||||
</List>
|
</List>
|
||||||
|
|
||||||
{/* If the user has a penalty/limit */}
|
{/* If the user has a penalty/limit */}
|
||||||
@ -728,8 +706,8 @@ class OrderPage extends Component {
|
|||||||
{/* Participants can see the "Cancel" Button, but cannot see the "Back" or "Take Order" buttons */}
|
{/* Participants can see the "Cancel" Button, but cannot see the "Back" or "Take Order" buttons */}
|
||||||
{this.state.is_participant ?
|
{this.state.is_participant ?
|
||||||
<>
|
<>
|
||||||
<this.CancelButton/>
|
{this.CancelButton()}
|
||||||
<this.BackButton/>
|
{this.BackButton()}
|
||||||
</>
|
</>
|
||||||
:
|
:
|
||||||
<Grid container spacing={1}>
|
<Grid container spacing={1}>
|
||||||
@ -768,27 +746,21 @@ class OrderPage extends Component {
|
|||||||
|
|
||||||
doubleOrderPagePhone=()=>{
|
doubleOrderPagePhone=()=>{
|
||||||
const { t } = this.props;
|
const { t } = this.props;
|
||||||
const [value, setValue] = React.useState(this.state.showContractBox);
|
|
||||||
|
|
||||||
const handleChange = (event, newValue) => {
|
|
||||||
this.setState({showContractBox:newValue})
|
|
||||||
setValue(newValue);
|
|
||||||
};
|
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<Box sx={{ width: '100%'}}>
|
<Box sx={{ width: '100%'}}>
|
||||||
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
|
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
|
||||||
<Tabs value={value} onChange={handleChange} variant="fullWidth" >
|
<Tabs value={this.state.tabValue} variant="fullWidth" >
|
||||||
<Tab label={t("Order")} {...this.a11yProps(0)} />
|
<Tab label={t("Order")} {...this.a11yProps(0)} onClick={() => this.setState({tabValue:0})}/>
|
||||||
<Tab label={t("Contract")} {...this.a11yProps(1)} />
|
<Tab label={t("Contract")} {...this.a11yProps(1)} onClick={() => this.setState({tabValue:1})}/>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</Box>
|
</Box>
|
||||||
<Grid container spacing={2}>
|
<Grid container spacing={2}>
|
||||||
<Grid item >
|
<Grid item >
|
||||||
<div style={{ width:330, display: this.state.showContractBox == 0 ? '':'none'}}>
|
<div style={{ width:330, display: this.state.tabValue == 0 ? '':'none'}}>
|
||||||
{this.orderBox()}
|
{this.orderBox()}
|
||||||
</div>
|
</div>
|
||||||
<div style={{display: this.state.showContractBox == 1 ? '':'none'}}>
|
<div style={{display: this.state.tabValue == 1 ? '':'none'}}>
|
||||||
<TradeBox push={this.props.history.push} getOrderDetails={this.getOrderDetails} pauseLoading={this.state.pauseLoading} width={330} data={this.state} completeSetState={this.completeSetState} />
|
<TradeBox push={this.props.history.push} getOrderDetails={this.getOrderDetails} pauseLoading={this.state.pauseLoading} width={330} data={this.state} completeSetState={this.completeSetState} />
|
||||||
</div>
|
</div>
|
||||||
</Grid>
|
</Grid>
|
||||||
@ -813,12 +785,12 @@ class OrderPage extends Component {
|
|||||||
<>
|
<>
|
||||||
{/* Desktop View */}
|
{/* Desktop View */}
|
||||||
<MediaQuery minWidth={920}>
|
<MediaQuery minWidth={920}>
|
||||||
<this.doubleOrderPageDesktop/>
|
{this.doubleOrderPageDesktop()}
|
||||||
</MediaQuery>
|
</MediaQuery>
|
||||||
|
|
||||||
{/* SmarPhone View */}
|
{/* SmarPhone View */}
|
||||||
<MediaQuery maxWidth={919}>
|
<MediaQuery maxWidth={919}>
|
||||||
<this.doubleOrderPagePhone/>
|
{this.doubleOrderPagePhone()}
|
||||||
</MediaQuery>
|
</MediaQuery>
|
||||||
</>
|
</>
|
||||||
:
|
:
|
||||||
|
@ -271,7 +271,7 @@ class TradeBox extends Component {
|
|||||||
return (
|
return (
|
||||||
<Grid container spacing={1}>
|
<Grid container spacing={1}>
|
||||||
{/* Make confirmation sound for HTLC received. */}
|
{/* Make confirmation sound for HTLC received. */}
|
||||||
<this.Sound soundFileName="locked-invoice"/>
|
{this.Sound(soundFileName="locked-invoice")}
|
||||||
<Grid item xs={12} align="center">
|
<Grid item xs={12} align="center">
|
||||||
<Typography color="green" component="subtitle1" variant="subtitle1">
|
<Typography color="green" component="subtitle1" variant="subtitle1">
|
||||||
<b>
|
<b>
|
||||||
@ -308,7 +308,7 @@ class TradeBox extends Component {
|
|||||||
return (
|
return (
|
||||||
<Grid container spacing={1}>
|
<Grid container spacing={1}>
|
||||||
{/* Make bell sound when taker is found */}
|
{/* Make bell sound when taker is found */}
|
||||||
<this.Sound soundFileName="taker-found"/>
|
{this.Sound(soundFileName="taker-found")}
|
||||||
<Grid item xs={12} align="center">
|
<Grid item xs={12} align="center">
|
||||||
<Typography component="subtitle1" variant="subtitle1">
|
<Typography component="subtitle1" variant="subtitle1">
|
||||||
<b>{t("A taker has been found!")}</b> {" " + this.stepXofY()}
|
<b>{t("A taker has been found!")}</b> {" " + this.stepXofY()}
|
||||||
@ -387,8 +387,8 @@ class TradeBox extends Component {
|
|||||||
return (
|
return (
|
||||||
<Grid container spacing={1}>
|
<Grid container spacing={1}>
|
||||||
{/* Make confirmation sound for HTLC received. */}
|
{/* Make confirmation sound for HTLC received. */}
|
||||||
<this.Sound soundFileName="locked-invoice"/>
|
{this.Sound(soundFileName="locked-invoice")}
|
||||||
<this.EnableTelegramDialog/>
|
{this.EnableTelegramDialog()}
|
||||||
<Grid item xs={12} align="center">
|
<Grid item xs={12} align="center">
|
||||||
<Typography component="subtitle1" variant="subtitle1">
|
<Typography component="subtitle1" variant="subtitle1">
|
||||||
<b> {t("Your order is public")} </b> {" " + this.stepXofY()}
|
<b> {t("Your order is public")} </b> {" " + this.stepXofY()}
|
||||||
@ -566,7 +566,7 @@ class TradeBox extends Component {
|
|||||||
<Grid container spacing={1}>
|
<Grid container spacing={1}>
|
||||||
<Grid item xs={12} align="center">
|
<Grid item xs={12} align="center">
|
||||||
{/* Make confirmation sound for HTLC received. */}
|
{/* Make confirmation sound for HTLC received. */}
|
||||||
<this.Sound soundFileName="locked-invoice"/>
|
{this.Sound(soundFileName="locked-invoice")}
|
||||||
<Typography color="primary" component="subtitle1" variant="subtitle1">
|
<Typography color="primary" component="subtitle1" variant="subtitle1">
|
||||||
<b> {t("Submit an invoice for {{amountSats}} Sats",{amountSats: pn(this.props.data.invoice_amount)})}
|
<b> {t("Submit an invoice for {{amountSats}} Sats",{amountSats: pn(this.props.data.invoice_amount)})}
|
||||||
</b> {" " + this.stepXofY()}
|
</b> {" " + this.stepXofY()}
|
||||||
@ -762,7 +762,7 @@ class TradeBox extends Component {
|
|||||||
return(
|
return(
|
||||||
<Grid container spacing={1}>
|
<Grid container spacing={1}>
|
||||||
{/* Make confirmation sound for HTLC received. */}
|
{/* Make confirmation sound for HTLC received. */}
|
||||||
<this.Sound soundFileName="locked-invoice"/>
|
{this.Sound(soundFileName="locked-invoice")}
|
||||||
<Grid item xs={12} align="center">
|
<Grid item xs={12} align="center">
|
||||||
<Typography component="subtitle1" variant="subtitle1">
|
<Typography component="subtitle1" variant="subtitle1">
|
||||||
<b>{t("The trade collateral is locked!")}</b> {" " + this.stepXofY()}
|
<b>{t("The trade collateral is locked!")}</b> {" " + this.stepXofY()}
|
||||||
@ -945,7 +945,7 @@ handleRatingRobosatsChange=(e)=>{
|
|||||||
return(
|
return(
|
||||||
<Grid container spacing={1}>
|
<Grid container spacing={1}>
|
||||||
{/* Make confirmation sound for Chat Open. */}
|
{/* Make confirmation sound for Chat Open. */}
|
||||||
<this.Sound soundFileName="chat-open"/>
|
{this.Sound(soundFileName="chat-open")}
|
||||||
<Grid item xs={12} align="center">
|
<Grid item xs={12} align="center">
|
||||||
<Typography component="subtitle1" variant="subtitle1">
|
<Typography component="subtitle1" variant="subtitle1">
|
||||||
<b> {this.props.data.is_seller ? t("Chat with the buyer"): t("Chat with the seller")}</b> {" " + this.stepXofY()}
|
<b> {this.props.data.is_seller ? t("Chat with the buyer"): t("Chat with the seller")}</b> {" " + this.stepXofY()}
|
||||||
@ -989,7 +989,7 @@ handleRatingRobosatsChange=(e)=>{
|
|||||||
return(
|
return(
|
||||||
<Grid container spacing={1}>
|
<Grid container spacing={1}>
|
||||||
{/* Make confirmation sound for Chat Open. */}
|
{/* Make confirmation sound for Chat Open. */}
|
||||||
<this.Sound soundFileName="successful"/>
|
{this.Sound(soundFileName="successful")}
|
||||||
<Grid item xs={12} align="center">
|
<Grid item xs={12} align="center">
|
||||||
<Typography component="h6" variant="h6">
|
<Typography component="h6" variant="h6">
|
||||||
{t("🎉Trade finished!🥳")}
|
{t("🎉Trade finished!🥳")}
|
||||||
@ -1152,8 +1152,8 @@ handleRatingRobosatsChange=(e)=>{
|
|||||||
const { t } = this.props;
|
const { t } = this.props;
|
||||||
return (
|
return (
|
||||||
<Grid container spacing={1} style={{ width:this.props.width}}>
|
<Grid container spacing={1} style={{ width:this.props.width}}>
|
||||||
<this.ConfirmDisputeDialog/>
|
{this.ConfirmDisputeDialog()}
|
||||||
<this.ConfirmFiatReceivedDialog/>
|
{this.ConfirmFiatReceivedDialog()}
|
||||||
<Grid item xs={12} align="center">
|
<Grid item xs={12} align="center">
|
||||||
<MediaQuery minWidth={920}>
|
<MediaQuery minWidth={920}>
|
||||||
<Typography component="h5" variant="h5">
|
<Typography component="h5" variant="h5">
|
||||||
|
@ -237,7 +237,7 @@ class UserGenPage extends Component {
|
|||||||
<ButtonGroup variant="contained" aria-label="outlined primary button group">
|
<ButtonGroup variant="contained" aria-label="outlined primary button group">
|
||||||
<Button disabled={this.state.loadingRobot} color='primary' to='/make/' component={Link}>{t("Make Order")}</Button>
|
<Button disabled={this.state.loadingRobot} color='primary' to='/make/' component={Link}>{t("Make Order")}</Button>
|
||||||
<Button color='inherit' style={{color: '#111111'}} onClick={this.handleClickOpenInfo}>{t("Info")}</Button>
|
<Button color='inherit' style={{color: '#111111'}} onClick={this.handleClickOpenInfo}>{t("Info")}</Button>
|
||||||
<this.InfoDialog/>
|
{this.InfoDialog()}
|
||||||
<Button disabled={this.state.loadingRobot} color='secondary' to='/book/' component={Link}>{t("View Book")}</Button>
|
<Button disabled={this.state.loadingRobot} color='secondary' to='/book/' component={Link}>{t("View Book")}</Button>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
Loading…
Reference in New Issue
Block a user