diff --git a/services/web/frontend/js/features/pdf-preview/components/timeout-upgrade-paywall-prompt.tsx b/services/web/frontend/js/features/pdf-preview/components/timeout-upgrade-paywall-prompt.tsx index 37b7756757..33b456c3d6 100644 --- a/services/web/frontend/js/features/pdf-preview/components/timeout-upgrade-paywall-prompt.tsx +++ b/services/web/frontend/js/features/pdf-preview/components/timeout-upgrade-paywall-prompt.tsx @@ -1,6 +1,7 @@ import getMeta from '@/utils/meta' -import { useMemo } from 'react' +import { useMemo, useState } from 'react' import TimeoutMessageAfterPaywallDismissal from './timeout-message-after-paywall-dismissal' +import { UpgradePrompt } from '@/shared/components/upgrade-prompt' const studentRoles = [ 'High-school student', @@ -9,18 +10,34 @@ const studentRoles = [ 'Doctoral student (e.g. PhD, MD, EngD)', ] -// We can display TimeoutMessageAfterPaywallDismissal after the user has dismissed the paywall. That logic can be implemented in this file or somewhere else? function TimeoutUpgradePaywallPrompt() { const odcRole = getMeta('ol-odcRole') const planPrices = getMeta('ol-paywallPlans') const isStudent = useMemo(() => studentRoles.includes(odcRole), [odcRole]) + const [isPaywallDismissed, setIsPaywallDismissed] = useState(false) + + function onClose() { + setIsPaywallDismissed(true) + } + return (
-

Current user is {!isStudent && 'not'} a student.

-

Student plan: {planPrices.student} per month

-

Standard plan: {planPrices.collaborator} per month

- + {!isPaywallDismissed ? ( + + ) : ( + + )}
) } diff --git a/services/web/frontend/js/shared/components/upgrade-prompt.tsx b/services/web/frontend/js/shared/components/upgrade-prompt.tsx index 9797f6a02a..7eba68a478 100644 --- a/services/web/frontend/js/shared/components/upgrade-prompt.tsx +++ b/services/web/frontend/js/shared/components/upgrade-prompt.tsx @@ -76,7 +76,7 @@ export function UpgradePrompt({

{summary}

- +
@@ -117,7 +117,7 @@ export function UpgradePrompt({
- +

{t('free')}

diff --git a/services/web/frontend/stylesheets/bootstrap-5/components/upgrade-prompt.scss b/services/web/frontend/stylesheets/bootstrap-5/components/upgrade-prompt.scss index ca261e7014..bb746129e6 100644 --- a/services/web/frontend/stylesheets/bootstrap-5/components/upgrade-prompt.scss +++ b/services/web/frontend/stylesheets/bootstrap-5/components/upgrade-prompt.scss @@ -2,6 +2,14 @@ border-radius: var(--border-radius-base); box-shadow: 0 4px 6px 0 #1e25301f; padding: var(--spacing-06); + background-color: var(--white); + container: inline-size; // Defines the parent as a container + + .upgrade-prompt-card-container { + @container (max-width: 700px) { + width: 100%; + } + } .row { margin-left: 0;