feat(core): add ai subscription landing page (#6657)

This commit is contained in:
CatsJuice
2024-04-22 09:03:27 +00:00
parent d36b5e14aa
commit e13024580d
8 changed files with 93 additions and 51 deletions
@@ -0,0 +1,5 @@
import { AIUpgradeSuccess } from '../components/affine/subscription-landing';
export const Component = () => {
return <AIUpgradeSuccess />;
};
@@ -1,15 +0,0 @@
import { cssVar } from '@toeverything/theme';
import { style } from '@vanilla-extract/css';
export const leftContentText = style({
fontSize: cssVar('fontBase'),
fontWeight: 400,
lineHeight: '1.6',
maxWidth: '548px',
});
export const mail = style({
color: cssVar('linkColor'),
textDecoration: 'none',
':visited': {
color: cssVar('linkColor'),
},
});
@@ -1,51 +1,5 @@
import { AuthPageContainer } from '@affine/component/auth-components';
import { Button } from '@affine/component/ui/button';
import { Trans } from '@affine/i18n';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { useCallback } from 'react';
import { useNavigateHelper } from '../hooks/use-navigate-helper';
import * as styles from './upgrade-success.css';
export const UpgradeSuccess = () => {
const t = useAFFiNEI18N();
const { jumpToIndex } = useNavigateHelper();
const openAffine = useCallback(() => {
jumpToIndex();
}, [jumpToIndex]);
const subtitle = (
<div className={styles.leftContentText}>
{t['com.affine.payment.upgrade-success-page.text']()}
<div>
<Trans
i18nKey={'com.affine.payment.upgrade-success-page.support'}
components={{
1: (
<a
href="mailto:support@toeverything.info"
className={styles.mail}
/>
),
}}
/>
</div>
</div>
);
return (
<AuthPageContainer
title={t['com.affine.payment.upgrade-success-page.title']()}
subtitle={subtitle}
>
<Button type="primary" size="extraLarge" onClick={openAffine}>
{t['com.affine.other-page.nav.open-affine']()}
</Button>
</AuthPageContainer>
);
};
import { CloudUpgradeSuccess } from '../components/affine/subscription-landing';
export const Component = () => {
return <UpgradeSuccess />;
return <CloudUpgradeSuccess />;
};