From 231b8a75427e2b14a3ef29fef0bc71c35acd97ee Mon Sep 17 00:00:00 2001 From: sdtsui Date: Wed, 9 Aug 2017 16:03:14 -0700 Subject: Vertically center modal in mobile view - @cjeria --- ui/app/components/modal.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ui') diff --git a/ui/app/components/modal.js b/ui/app/components/modal.js index 89de1cedb..bc365c0e9 100644 --- a/ui/app/components/modal.js +++ b/ui/app/components/modal.js @@ -5,6 +5,7 @@ const connect = require('react-redux').connect const FadeModal = require('boron').FadeModal const actions = require('../actions') const isMobileView = require('../../lib/is-mobile-view') +const isPopupOrNotification = require('../../../app/scripts/lib/is-popup-or-notification') function mapStateToProps (state) { return { @@ -29,12 +30,14 @@ module.exports = connect(mapStateToProps, mapDispatchToProps)(Modal) const mobileModalStyles = { width: '95%', + // Used to create matching t/l/r/b space in mobile view. + top: isPopupOrNotification() === 'popup' ? '47vh' : '36.5vh', boxShadow: 'rgba(0, 0, 0, 0.15) 0px 2px 2px 2px', } const laptopModalStyles = { width: '66%', - top: '30%', + top: 'calc(30% + 10px)', boxShadow: 'rgba(0, 0, 0, 0.15) 0px 2px 2px 2px', } -- cgit v1.2.3