mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 06:18:45 +08:00
612310bc26
AF-1738 AF-1735 AF-1731 AF-1721 AF-1717 AF-1736 AF-1727 AF-1719 AF-1877 UI for team workspaces : - add upgrade to team & successful upgrade page ( `/upgrade-to-team` & `/upgrade-success/team`) - update team plans on pricing page ( settings —> pricing plans ) - update reaching the usage/member limit modal - update invite member modal - update member CRUD options
84 lines
2.0 KiB
TypeScript
84 lines
2.0 KiB
TypeScript
import { ConfirmModal } from '@affine/component/ui/modal';
|
|
import { useI18n } from '@affine/i18n';
|
|
import { useCallback } from 'react';
|
|
|
|
import * as styles from './member-limit-modal.css';
|
|
|
|
export interface MemberLimitModalProps {
|
|
isFreePlan: boolean;
|
|
open: boolean;
|
|
plan: string;
|
|
quota: string;
|
|
setOpen: (value: boolean) => void;
|
|
onConfirm: () => void;
|
|
}
|
|
|
|
export const MemberLimitModal = ({
|
|
isFreePlan,
|
|
open,
|
|
plan,
|
|
quota,
|
|
setOpen,
|
|
onConfirm,
|
|
}: MemberLimitModalProps) => {
|
|
const t = useI18n();
|
|
const handleConfirm = useCallback(() => {
|
|
setOpen(false);
|
|
onConfirm();
|
|
}, [onConfirm, setOpen]);
|
|
|
|
return (
|
|
<ConfirmModal
|
|
open={open}
|
|
onOpenChange={setOpen}
|
|
title={t['com.affine.payment.member-limit.title']()}
|
|
description={
|
|
<ConfirmDescription plan={plan} quota={quota} isFreePlan={isFreePlan} />
|
|
}
|
|
confirmText={t['com.affine.payment.upgrade']()}
|
|
confirmButtonOptions={{
|
|
variant: 'primary',
|
|
}}
|
|
onConfirm={handleConfirm}
|
|
></ConfirmModal>
|
|
);
|
|
};
|
|
|
|
export const ConfirmDescription = ({
|
|
isFreePlan,
|
|
plan,
|
|
quota,
|
|
}: {
|
|
isFreePlan: boolean;
|
|
plan: string;
|
|
quota: string;
|
|
}) => {
|
|
const t = useI18n();
|
|
return (
|
|
<div>
|
|
{t['com.affine.payment.member-limit.description']({
|
|
planName: plan,
|
|
quota: quota,
|
|
})}
|
|
<ul className={styles.ulStyle}>
|
|
{isFreePlan && (
|
|
<li className={styles.liStyle}>
|
|
<div className={styles.prefixDot} />
|
|
{t[
|
|
'com.affine.payment.member-limit.description.tips-for-free-plan'
|
|
]()}
|
|
</li>
|
|
)}
|
|
<li className={styles.liStyle}>
|
|
<div className={styles.prefixDot} />
|
|
{t['com.affine.payment.member-limit.description.tips-1']()}
|
|
</li>
|
|
<li className={styles.liStyle}>
|
|
<div className={styles.prefixDot} />
|
|
{t['com.affine.payment.member-limit.description.tips-2']()}
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
);
|
|
};
|