fix(core): cloud s subscription resume button's content is blank (#7783)

This commit is contained in:
CatsJuice
2024-08-08 08:43:05 +00:00
parent f2eafc374c
commit 03fd23de39
2 changed files with 16 additions and 17 deletions
@@ -10,7 +10,6 @@ import { SubscriptionPlan, SubscriptionStatus } from '@affine/graphql';
import { Trans, useI18n } from '@affine/i18n'; import { Trans, useI18n } from '@affine/i18n';
import { DoneIcon } from '@blocksuite/icons/rc'; import { DoneIcon } from '@blocksuite/icons/rc';
import { useLiveData, useService } from '@toeverything/infra'; import { useLiveData, useService } from '@toeverything/infra';
import { assignInlineVars } from '@vanilla-extract/dynamic';
import clsx from 'clsx'; import clsx from 'clsx';
import { useSetAtom } from 'jotai'; import { useSetAtom } from 'jotai';
import { nanoid } from 'nanoid'; import { nanoid } from 'nanoid';
@@ -424,15 +423,13 @@ const ResumeButton = () => {
return ( return (
<ResumeAction open={open} onOpenChange={setOpen}> <ResumeAction open={open} onOpenChange={setOpen}>
<Button <Button className={styles.resumeAction} onClick={handleClick}>
className={styles.resumeAction} <span data-show-hover="true" className={clsx(styles.resumeContent)}>
onClick={handleClick} {t['com.affine.payment.resume-renewal']()}
style={assignInlineVars({ </span>
'--default-content': t['com.affine.payment.current-plan'](), <span data-show-hover="false" className={clsx(styles.resumeContent)}>
'--hover-content': t['com.affine.payment.resume-renewal'](), {t['com.affine.payment.current-plan']()}
})} </span>
>
<span className={styles.resumeActionContent} />
</Button> </Button>
</ResumeAction> </ResumeAction>
); );
@@ -179,14 +179,16 @@ export const planAction = style({
width: '100%', width: '100%',
}); });
export const resumeAction = style([planAction, {}]); export const resumeAction = style([planAction, {}]);
export const resumeActionContent = style({ export const resumeContent = style({
':after': {
content: 'var(--default-content)',
},
selectors: { selectors: {
[`${resumeAction}:hover &:after`]: { [`&[data-show-hover="true"], ${resumeAction}:hover &[data-show-hover="false"]`]:
content: 'var(--hover-content)', {
}, display: 'none',
},
[`&[data-show-hover="false"], ${resumeAction}:hover &[data-show-hover="true"]`]:
{
display: 'block',
},
}, },
}); });
export const planBenefits = style({ export const planBenefits = style({