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-07-21 11:35:52 -04:00
|
|
|
import PremiumFeaturesLink from './premium-features-link'
|
2024-09-30 05:49:18 -04:00
|
|
|
import OLCard from '@/features/ui/components/ol/ol-card'
|
|
|
|
import OLRow from '@/features/ui/components/ol/ol-row'
|
|
|
|
import OLCol from '@/features/ui/components/ol/ol-col'
|
|
|
|
import OLNotification from '@/features/ui/components/ol/ol-notification'
|
2023-01-18 09:38:35 -05:00
|
|
|
|
|
|
|
function SubscriptionDashboard() {
|
|
|
|
const { t } = useTranslation()
|
2023-08-11 07:12:33 -04:00
|
|
|
const {
|
|
|
|
hasDisplayedSubscription,
|
|
|
|
hasSubscription,
|
|
|
|
hasValidActiveSubscription,
|
|
|
|
} = useSubscriptionDashboardContext()
|
2023-01-18 09:38:35 -05:00
|
|
|
|
2024-06-18 06:01:37 -04:00
|
|
|
const fromPlansPage = getMeta('ol-fromPlansPage')
|
2023-02-23 11:51:19 -05:00
|
|
|
|
2023-01-18 09:38:35 -05:00
|
|
|
return (
|
|
|
|
<div className="container">
|
2024-09-30 05:49:18 -04:00
|
|
|
<OLRow>
|
|
|
|
<OLCol lg={{ span: 8, offset: 2 }}>
|
2023-02-23 11:51:19 -05:00
|
|
|
{fromPlansPage && (
|
2024-09-30 05:49:18 -04:00
|
|
|
<OLNotification
|
|
|
|
className="mb-4"
|
|
|
|
aria-live="polite"
|
|
|
|
content={t('you_already_have_a_subscription')}
|
|
|
|
type="warning"
|
|
|
|
/>
|
2023-02-23 11:51:19 -05:00
|
|
|
)}
|
2024-09-30 05:49:18 -04:00
|
|
|
<OLCard>
|
2023-01-18 09:38:35 -05:00
|
|
|
<div className="page-header">
|
|
|
|
<h1>{t('your_subscription')}</h1>
|
|
|
|
</div>
|
|
|
|
|
2024-09-30 05:49:18 -04:00
|
|
|
<div>
|
|
|
|
<PersonalSubscription />
|
|
|
|
<ManagedGroupSubscriptions />
|
|
|
|
<ManagedInstitutions />
|
|
|
|
<ManagedPublishers />
|
|
|
|
<GroupSubscriptionMemberships />
|
|
|
|
<InstitutionMemberships />
|
|
|
|
{hasValidActiveSubscription && <PremiumFeaturesLink />}
|
|
|
|
{!hasDisplayedSubscription &&
|
|
|
|
(hasSubscription ? <ContactSupport /> : <FreePlan />)}
|
|
|
|
</div>
|
|
|
|
</OLCard>
|
|
|
|
</OLCol>
|
|
|
|
</OLRow>
|
2023-01-18 09:38:35 -05:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default SubscriptionDashboard
|