From cad000d838b71c5d7fbe321270f61563dc4dcb70 Mon Sep 17 00:00:00 2001 From: "F. Mitjans" Date: Thu, 1 Sep 2022 00:05:20 -0400 Subject: [PATCH] Make Bottom Bar scale with fontsize --- frontend/src/components/BottomBar.js | 27 +++++++++++++-------------- frontend/src/components/HomePage.js | 8 +++++--- frontend/static/css/index.css | 2 -- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/frontend/src/components/BottomBar.js b/frontend/src/components/BottomBar.js index 01ccc126..152c5c58 100644 --- a/frontend/src/components/BottomBar.js +++ b/frontend/src/components/BottomBar.js @@ -149,11 +149,15 @@ bottomBarDesktop =()=>{ const { t } = this.props; var hasRewards = this.props.earnedRewards > 0 ? true: false; var hasOrder = this.props.activeOrderId > 0 & !this.state.profileShown & this.props.avatarLoaded ? true : false; - + const fontSize = this.props.theme.typography.fontSize; + const fontSizeFactor = fontSize / 14; // default fontSize is 14 + const typographyProps = { + primaryTypographyProps: {fontSize: fontSize}, + secondaryTypographyProps: {fontSize: fontSize * 12/14} + } return( - + -
@@ -162,7 +166,7 @@ bottomBarDesktop =()=>{ title={(hasRewards ? t("You can claim satoshis!")+" ": "" )+ (hasOrder ? t("You have an active order"):"")} > - + 0 & !this.props.profileShown) ? "": null} color="primary"> { @@ -212,8 +215,7 @@ bottomBarDesktop =()=>{ @@ -232,8 +234,7 @@ bottomBarDesktop =()=>{ @@ -248,8 +249,7 @@ bottomBarDesktop =()=>{ @@ -264,8 +264,7 @@ bottomBarDesktop =()=>{ diff --git a/frontend/src/components/HomePage.js b/frontend/src/components/HomePage.js index 184e6d3d..7bf59fb6 100644 --- a/frontend/src/components/HomePage.js +++ b/frontend/src/components/HomePage.js @@ -40,9 +40,11 @@ export default class HomePage extends Component { } render() { + const fontSize = this.props.theme.typography.fontSize; + const fontSizeFactor = fontSize / 14; // default fontSize is 14 return ( -
+
}/> }/> @@ -51,8 +53,8 @@ export default class HomePage extends Component { }/>
-
- +
+
); diff --git a/frontend/static/css/index.css b/frontend/static/css/index.css index c9395a30..3df760db 100644 --- a/frontend/static/css/index.css +++ b/frontend/static/css/index.css @@ -61,8 +61,6 @@ input[type=number] { .bottomBar { position: fixed; bottom: 0; - width: 100%; - height: 40px; } .amboss{