From e37eeacdec76f371cd1c5c59523f7a573fbd45cd Mon Sep 17 00:00:00 2001 From: Tim Glasgow Date: Mon, 1 Aug 2022 00:14:27 -0500 Subject: [PATCH] calculate dimensions in metrics constructor --- squarenotsquare/src/themes/Metrics.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/squarenotsquare/src/themes/Metrics.js b/squarenotsquare/src/themes/Metrics.js index 98fcf37..9484858 100644 --- a/squarenotsquare/src/themes/Metrics.js +++ b/squarenotsquare/src/themes/Metrics.js @@ -14,16 +14,20 @@ class AppMetrics { this.screenWidth = width; this.screenHeight = height; } + + this.screenSections = { + headerHeight: this.normalize(20), + sectionWidth: this.screenWidth + } + + this.icons = { + splashIcon: this.normalize(100) + } } normalize(size){ return (size * this.scalar); } - - screenSections = { - headerHeight: this.normalize(20), - sectionWidth: this.screenWidth - } } const Metrics = new AppMetrics();