From 292addc08145d7210c27e362bb829d8b6421e9c7 Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Sat, 29 Jan 2022 06:42:54 -0800 Subject: [PATCH] Fix stateless tradebox --- frontend/src/components/OrderPage.js | 70 ++++++++++------------------ frontend/src/components/TradeBox.js | 4 +- 2 files changed, 25 insertions(+), 49 deletions(-) diff --git a/frontend/src/components/OrderPage.js b/frontend/src/components/OrderPage.js index ae75fd41..da923dc9 100644 --- a/frontend/src/components/OrderPage.js +++ b/frontend/src/components/OrderPage.js @@ -36,39 +36,6 @@ 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); @@ -80,6 +47,7 @@ export default class OrderPage extends Component { loading: true, openCancel: false, openCollaborativeCancel: false, + showContractBox: 1, }; this.orderId = this.props.match.params.orderId; this.getCurrencyDict(); @@ -334,7 +302,7 @@ export default class OrderPage extends Component { - + ) @@ -542,36 +510,46 @@ export default class OrderPage extends Component { {this.orderBox()} - + ) } + a11yProps(index) { + return { + id: `simple-tab-${index}`, + 'aria-controls': `simple-tabpanel-${index}`, + }; + } + doubleOrderPagePhone=()=>{ - const [value, setValue] = React.useState(1); + const [value, setValue] = React.useState(this.state.showContractBox); const handleChange = (event, newValue) => { + this.setState({showContractBox:newValue}) setValue(newValue); }; return( - - - + + + - - - {this.orderBox()} + + +
+ {this.orderBox()} +
+
+ +
-
- - - +
); } diff --git a/frontend/src/components/TradeBox.js b/frontend/src/components/TradeBox.js index cf4f26d7..0dc5ebfc 100644 --- a/frontend/src/components/TradeBox.js +++ b/frontend/src/components/TradeBox.js @@ -360,8 +360,6 @@ export default class TradeBox extends Component { return ( - {/* In case the taker was very fast to scan the bond, make the taker found alarm sound again */} - Submit a LN invoice for {pn(this.props.data.invoice_amount)} Sats @@ -769,7 +767,7 @@ handleRatingChange=(e)=>{ render() { return ( - +