diff --git a/frontend/src/components/BookPage.js b/frontend/src/components/BookPage.js index a4621ec1..a2886dd2 100644 --- a/frontend/src/components/BookPage.js +++ b/frontend/src/components/BookPage.js @@ -107,43 +107,90 @@ class BookPage extends Component { ); }; - mainView = () => { + mainView = (doubleView, widthEm, heightEm) => { if (this.props.bookNotFound) { return this.NoOrdersFound(); } - if (this.state.view === 'depth') { + if (doubleView) { + const width = widthEm * 0.9; + const bookTableWidth = 85; + const chartWidthEm = width - bookTableWidth; + const tableWidthXS = (bookTableWidth / width) * 12; + const chartWidthXS = (chartWidthEm / width) * 12; + console.log(bookTableWidth, chartWidthEm, tableWidthXS, chartWidthXS); return ( - + + + + + + + + ); } else { - return ( - - ); + if (this.state.view === 'depth') { + return ( + + ); + } else { + return ( + + ); + } } }; - getTitle = () => { + getTitle = (doubleView) => { const { t } = this.props; - if (this.state.view == 'list') { + if (this.state.view == 'list' || doubleView) { if (this.props.type == 0) { return t('You are SELLING BTC for {{currencyCode}}', { currencyCode: this.props.bookCurrencyCode, @@ -160,10 +207,10 @@ class BookPage extends Component { } }; - render() { + mainFilters = () => { const { t } = this.props; return ( - + <> this.setState({ loading: true }) & this.getOrderDetails()} @@ -235,13 +282,26 @@ class BookPage extends Component { + + ); + }; + + render() { + const { t } = this.props; + const widthEm = this.props.windowWidth / this.props.theme.typography.fontSize; + const heightEm = this.props.windowHeight / this.props.theme.typography.fontSize; + const doubleView = widthEm > 115; + + return ( + + {this.mainFilters()} - {this.getTitle()} + {this.getTitle(doubleView)} - {this.mainView()} + {this.mainView(doubleView, widthEm, heightEm)} @@ -250,17 +310,23 @@ class BookPage extends Component { - + {doubleView ? null : ( + + )} ) : null}