Merge pull request #9809 from overleaf/ii-dashboard-mobile-view-improvements-2

[web] Projects dashboard improvements 2

GitOrigin-RevId: c34e91d55785564638ac1d54412a7e5c350fd410
This commit is contained in:
Jessica Lawshe 2022-10-03 08:31:55 -05:00 committed by Copybot
parent 94038e1b04
commit fd9c66404a
5 changed files with 99 additions and 78 deletions

View file

@ -6,24 +6,29 @@ type CommonsPlanProps = Pick<CommonsPlanSubscription, 'subscription' | 'plan'>
function CommonsPlan({ subscription, plan }: CommonsPlanProps) {
const { t } = useTranslation()
const currentPlanLabel = (
<Trans i18nKey="premium_plan_label" components={{ b: <strong /> }} />
)
return (
<Tooltip
description={t('commons_plan_tooltip', {
plan: plan.name,
institution: subscription.name,
})}
id="commons-plan"
overlayProps={{ placement: 'bottom' }}
>
<a
href="/learn/how-to/Overleaf_premium_features"
className="current-plan-label"
<>
<span className="current-plan-label visible-xs">{currentPlanLabel}</span>
<Tooltip
description={t('commons_plan_tooltip', {
plan: plan.name,
institution: subscription.name,
})}
id="commons-plan"
overlayProps={{ placement: 'bottom' }}
>
<Trans i18nKey="premium_plan_label" components={{ b: <strong /> }} />{' '}
<span className="info-badge" />
</a>
</Tooltip>
<a
href="/learn/how-to/Overleaf_premium_features"
className="current-plan-label hidden-xs"
>
{currentPlanLabel} <span className="info-badge" />
</a>
</Tooltip>
</>
)
}

View file

@ -5,17 +5,18 @@ import * as eventTracking from '../../../../infrastructure/event-tracking'
function FreePlan() {
const { t } = useTranslation()
const currentPlanLabel = (
<Trans i18nKey="free_plan_label" components={{ b: <strong /> }} />
)
function handleClick() {
const handleClick = () => {
eventTracking.send('subscription-funnel', 'dashboard-top', 'upgrade')
eventTracking.sendMB('upgrade-button-click', { source: 'dashboard-top' })
}
return (
<>
<span className="current-plan-label visible-xs">
<Trans i18nKey="free_plan_label" components={{ b: <strong /> }} />
</span>
<span className="current-plan-label visible-xs">{currentPlanLabel}</span>
<Tooltip
description={t('free_plan_tooltip')}
id="free-plan"
@ -25,8 +26,7 @@ function FreePlan() {
href="/learn/how-to/Overleaf_premium_features"
className="current-plan-label hidden-xs"
>
<Trans i18nKey="free_plan_label" components={{ b: <strong /> }} />{' '}
<span className="info-badge" />
{currentPlanLabel} <span className="info-badge" />
</a>
</Tooltip>{' '}
<Button

View file

@ -9,38 +9,42 @@ type GroupPlanProps = Pick<
function GroupPlan({ subscription, plan, remainingTrialDays }: GroupPlanProps) {
const { t } = useTranslation()
const currentPlanLabel =
remainingTrialDays >= 0 ? (
remainingTrialDays === 1 ? (
<Trans i18nKey="trial_last_day" components={{ b: <strong /> }} />
) : (
<Trans
i18nKey="trial_remaining_days"
components={{ b: <strong /> }}
values={{ days: remainingTrialDays }}
/>
)
) : (
<Trans i18nKey="premium_plan_label" components={{ b: <strong /> }} />
)
return (
<Tooltip
description={t(
subscription.teamName != null
? 'group_plan_with_name_tooltip'
: 'group_plan_tooltip',
{ plan: plan.name, groupName: subscription.teamName }
)}
id="group-plan"
overlayProps={{ placement: 'bottom' }}
>
<a
href="/learn/how-to/Overleaf_premium_features"
className="current-plan-label"
<>
<span className="current-plan-label visible-xs">{currentPlanLabel}</span>
<Tooltip
description={t(
subscription.teamName != null
? 'group_plan_with_name_tooltip'
: 'group_plan_tooltip',
{ plan: plan.name, groupName: subscription.teamName }
)}
id="group-plan"
overlayProps={{ placement: 'bottom' }}
>
{remainingTrialDays >= 0 ? (
remainingTrialDays === 1 ? (
<Trans i18nKey="trial_last_day" components={{ b: <strong /> }} />
) : (
<Trans
i18nKey="trial_remaining_days"
components={{ b: <strong /> }}
values={{ days: remainingTrialDays }}
/>
)
) : (
<Trans i18nKey="premium_plan_label" components={{ b: <strong /> }} />
)}{' '}
<span className="info-badge" />
</a>
</Tooltip>
<a
href="/learn/how-to/Overleaf_premium_features"
className="current-plan-label hidden-xs"
>
{currentPlanLabel} <span className="info-badge" />
</a>
</Tooltip>
</>
)
}

View file

@ -9,33 +9,37 @@ type IndividualPlanProps = Pick<
function IndividualPlan({ plan, remainingTrialDays }: IndividualPlanProps) {
const { t } = useTranslation()
const currentPlanLabel =
remainingTrialDays >= 0 ? (
remainingTrialDays === 1 ? (
<Trans i18nKey="trial_last_day" components={{ b: <strong /> }} />
) : (
<Trans
i18nKey="trial_remaining_days"
components={{ b: <strong /> }}
values={{ days: remainingTrialDays }}
/>
)
) : (
<Trans i18nKey="premium_plan_label" components={{ b: <strong /> }} />
)
return (
<Tooltip
description={t('plan_tooltip', { plan: plan.name })}
id="individual-plan"
overlayProps={{ placement: 'bottom' }}
>
<a
href="/learn/how-to/Overleaf_premium_features"
className="current-plan-label"
<>
<span className="current-plan-label visible-xs">{currentPlanLabel}</span>
<Tooltip
description={t('plan_tooltip', { plan: plan.name })}
id="individual-plan"
overlayProps={{ placement: 'bottom' }}
>
{remainingTrialDays >= 0 ? (
remainingTrialDays === 1 ? (
<Trans i18nKey="trial_last_day" components={{ b: <strong /> }} />
) : (
<Trans
i18nKey="trial_remaining_days"
components={{ b: <strong /> }}
values={{ days: remainingTrialDays }}
/>
)
) : (
<Trans i18nKey="premium_plan_label" components={{ b: <strong /> }} />
)}{' '}
<span className="info-badge" />
</a>
</Tooltip>
<a
href="/learn/how-to/Overleaf_premium_features"
className="current-plan-label hidden-xs"
>
{currentPlanLabel} <span className="info-badge" />
</a>
</Tooltip>
</>
)
}

View file

@ -98,24 +98,32 @@ export default function EditTagModal({
<div className="modal-footer-left">
<Button
onClick={() => runDeleteTag(tag._id)}
bsStyle="primary"
bsStyle="danger"
disabled={isDeleteLoading || isRenameLoading}
>
{isDeleteLoading ? <>{t('deleting')} &hellip;</> : t('delete')}
{isDeleteLoading ? (
<>{t('deleting')} &hellip;</>
) : (
t('delete_folder')
)}
</Button>
</div>
<Button
onClick={onClose}
disabled={isDeleteLoading || isRenameLoading}
>
{t('cancel')}
{t('save_or_cancel-cancel')}
</Button>
<Button
onClick={() => runRenameTag(tag._id)}
bsStyle="primary"
disabled={isRenameLoading || isDeleteLoading || !newTagName?.length}
>
{isRenameLoading ? <>{t('saving')} &hellip;</> : t('save_changes')}
{isRenameLoading ? (
<>{t('saving')} &hellip;</>
) : (
t('save_or_cancel-save')
)}
</Button>
</div>
{(isDeleteError || isRenameError) && (