diff options
Diffstat (limited to 'ui/lib')
-rw-r--r-- | ui/lib/feature-toggle-utils.js | 11 | ||||
-rw-r--r-- | ui/lib/icon-factory.js | 2 | ||||
-rw-r--r-- | ui/lib/is-mobile-view.js | 5 |
3 files changed, 17 insertions, 1 deletions
diff --git a/ui/lib/feature-toggle-utils.js b/ui/lib/feature-toggle-utils.js new file mode 100644 index 000000000..6d4e461ca --- /dev/null +++ b/ui/lib/feature-toggle-utils.js @@ -0,0 +1,11 @@ +function checkFeatureToggle (name) { + const queryPairMap = window.location.search.substr(1).split('&') + .map(pair => pair.split('=')) + .reduce((pairs, [key, value]) => ({...pairs, [key]: value }), {}) + const featureToggles = queryPairMap['ft'] ? queryPairMap['ft'].split(',') : [] + return Boolean(featureToggles.find(ft => ft === name)) +} + +module.exports = { + checkFeatureToggle, +} diff --git a/ui/lib/icon-factory.js b/ui/lib/icon-factory.js index 27a74de66..31498a3a9 100644 --- a/ui/lib/icon-factory.js +++ b/ui/lib/icon-factory.js @@ -53,7 +53,7 @@ function imageElFor (address) { const path = `images/contract/${fileName}` const img = document.createElement('img') img.src = path - img.style.width = '75%' + img.style.width = '100%' return img } diff --git a/ui/lib/is-mobile-view.js b/ui/lib/is-mobile-view.js new file mode 100644 index 000000000..78fd6cb54 --- /dev/null +++ b/ui/lib/is-mobile-view.js @@ -0,0 +1,5 @@ +// Checks if viewport at invoke time fits mobile dimensions +// isMobileView :: () => Bool +const isMobileView = () => window.matchMedia('screen and (max-width: 575px)').matches + +module.exports = isMobileView |