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