diff options
Diffstat (limited to 'src/features/trialStatusBar')
-rw-r--r-- | src/features/trialStatusBar/containers/TrialStatusBarScreen.js | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/features/trialStatusBar/containers/TrialStatusBarScreen.js b/src/features/trialStatusBar/containers/TrialStatusBarScreen.js index 715251854..e0f5ab5f2 100644 --- a/src/features/trialStatusBar/containers/TrialStatusBarScreen.js +++ b/src/features/trialStatusBar/containers/TrialStatusBarScreen.js | |||
@@ -12,7 +12,8 @@ import { trialStatusBarStore } from '..'; | |||
12 | import { i18nPlanName } from '../../../helpers/plan-helpers'; | 12 | import { i18nPlanName } from '../../../helpers/plan-helpers'; |
13 | import PaymentStore from '../../../stores/PaymentStore'; | 13 | import PaymentStore from '../../../stores/PaymentStore'; |
14 | 14 | ||
15 | @inject('stores', 'actions') @observer | 15 | @inject('stores', 'actions') |
16 | @observer | ||
16 | class TrialStatusBarScreen extends Component { | 17 | class TrialStatusBarScreen extends Component { |
17 | static contextTypes = { | 18 | static contextTypes = { |
18 | intl: intlShape, | 19 | intl: intlShape, |
@@ -41,7 +42,9 @@ class TrialStatusBarScreen extends Component { | |||
41 | 42 | ||
42 | calculateRestTime() { | 43 | calculateRestTime() { |
43 | const { trialEndTime } = trialStatusBarStore; | 44 | const { trialEndTime } = trialStatusBarStore; |
44 | const percent = Math.abs(100 - Math.abs(trialEndTime.asMilliseconds()) * 100 / ms('14d')).toFixed(2); | 45 | const percent = ( |
46 | Math.abs(100 - Math.abs(trialEndTime.asMilliseconds()) * 100) / ms('14d') | ||
47 | ).toFixed(2); | ||
45 | const restTime = trialEndTime.humanize(); | 48 | const restTime = trialEndTime.humanize(); |
46 | const hasEnded = trialEndTime.asMilliseconds() > 0; | 49 | const hasEnded = trialEndTime.asMilliseconds() > 0; |
47 | 50 | ||
@@ -58,18 +61,19 @@ class TrialStatusBarScreen extends Component { | |||
58 | }); | 61 | }); |
59 | } | 62 | } |
60 | 63 | ||
61 | |||
62 | render() { | 64 | render() { |
63 | const { intl } = this.context; | 65 | const { intl } = this.context; |
64 | 66 | ||
65 | const { | 67 | const { |
66 | showOverlay, | 68 | showOverlay, percent, restTime, hasEnded, |
67 | percent, | ||
68 | restTime, | ||
69 | hasEnded, | ||
70 | } = this.state; | 69 | } = this.state; |
71 | 70 | ||
72 | if (!trialStatusBarStore || !trialStatusBarStore.isFeatureActive || !showOverlay || !trialStatusBarStore.showTrialStatusBarOverlay) { | 71 | if ( |
72 | !trialStatusBarStore | ||
73 | || !trialStatusBarStore.isFeatureActive | ||
74 | || !showOverlay | ||
75 | || !trialStatusBarStore.showTrialStatusBarOverlay | ||
76 | ) { | ||
73 | return null; | 77 | return null; |
74 | } | 78 | } |
75 | 79 | ||