2023-01-18 09:38:35 -05:00
|
|
|
import { useTranslation } from 'react-i18next'
|
2023-02-22 07:18:01 -05:00
|
|
|
import ContactSupport from './contact-support-for-custom-subscription'
|
2023-02-22 07:10:02 -05:00
|
|
|
import GroupSubscriptionMemberships from './group-subscription-memberships'
|
2023-01-18 09:38:35 -05:00
|
|
|
import InstitutionMemberships from './institution-memberships'
|
2023-01-18 09:38:51 -05:00
|
|
|
import FreePlan from './free-plan'
|
2023-02-22 06:50:24 -05:00
|
|
|
import ManagedPublishers from './managed-publishers'
|
2023-01-26 11:48:30 -05:00
|
|
|
import PersonalSubscription from './personal-subscription'
|
2023-01-31 10:42:52 -05:00
|
|
|
import ManagedGroupSubscriptions from './managed-group-subscriptions'
|
2023-02-14 05:21:25 -05:00
|
|
|
import ManagedInstitutions from './managed-institutions'
|
2023-02-07 10:38:04 -05:00
|
|
|
import { useSubscriptionDashboardContext } from '../../context/subscription-dashboard-context'
|
2023-02-23 11:51:19 -05:00
|
|
|
import getMeta from '../../../../utils/meta'
|
2023-01-18 09:38:35 -05:00
|
|
|
|
|
|
|
function SubscriptionDashboard() {
|
|
|
|
const { t } = useTranslation()
|
2023-02-22 07:18:01 -05:00
|
|
|
const { hasDisplayedSubscription, hasSubscription } =
|
|
|
|
useSubscriptionDashboardContext()
|
2023-01-18 09:38:35 -05:00
|
|
|
|
2023-02-23 11:51:19 -05:00
|
|
|
const fromPlansPage: boolean = getMeta('ol-fromPlansPage')
|
|
|
|
|
2023-01-18 09:38:35 -05:00
|
|
|
return (
|
|
|
|
<div className="container">
|
|
|
|
<div className="row">
|
|
|
|
<div className="col-md-8 col-md-offset-2">
|
2023-02-23 11:51:19 -05:00
|
|
|
{fromPlansPage && (
|
2023-02-27 09:15:37 -05:00
|
|
|
<div className="alert alert-warning" aria-live="polite">
|
2023-02-23 11:51:19 -05:00
|
|
|
{t('you_already_have_a_subscription')}
|
2023-02-27 09:15:37 -05:00
|
|
|
</div>
|
2023-02-23 11:51:19 -05:00
|
|
|
)}
|
2023-01-18 09:38:35 -05:00
|
|
|
<div className="card">
|
|
|
|
<div className="page-header">
|
|
|
|
<h1>{t('your_subscription')}</h1>
|
|
|
|
</div>
|
|
|
|
|
2023-02-07 10:38:04 -05:00
|
|
|
<PersonalSubscription />
|
|
|
|
<ManagedGroupSubscriptions />
|
2023-02-14 05:21:25 -05:00
|
|
|
<ManagedInstitutions />
|
2023-02-22 06:50:24 -05:00
|
|
|
<ManagedPublishers />
|
2023-02-22 07:10:02 -05:00
|
|
|
<GroupSubscriptionMemberships />
|
2023-02-07 10:38:04 -05:00
|
|
|
<InstitutionMemberships />
|
2023-02-22 07:18:01 -05:00
|
|
|
{!hasDisplayedSubscription &&
|
|
|
|
(hasSubscription ? <ContactSupport /> : <FreePlan />)}
|
2023-01-18 09:38:35 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default SubscriptionDashboard
|