-
Notifications
You must be signed in to change notification settings - Fork 13
/
DashboardPage.js
44 lines (34 loc) · 920 Bytes
/
DashboardPage.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import React, { Component } from 'react'
import { theme } from 'react-saasify'
import { observer, inject } from 'mobx-react'
import { withTracker } from 'lib/with-tracker'
import { Redirect } from 'react-router-dom'
import plans from 'lib/pricing-plans'
import {
NavHeader,
NavFooter,
ScrollToTopOnMount,
DashboardSection,
OnboardingSection
} from 'components'
import styles from './styles.module.css'
@withTracker
@inject('auth')
@observer
export class DashboardPage extends Component {
render() {
const { auth } = this.props
if (!plans.context.hasFreeTier && !auth.consumer?.plan) {
return <Redirect to={`/checkout?plan=${plans[0].slug}`} />
}
return (
<div className={theme(styles, 'dashboard-page')}>
<ScrollToTopOnMount />
<NavHeader fixed />
<DashboardSection />
<OnboardingSection />
<NavFooter />
</div>
)
}
}