Files
AFFiNE-Mirror/packages/frontend/admin/src/modules/about/about.tsx
JimmFly 1b715e588c feat(core): support install license for self hosted client (#12287)
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Added the ability to upload and replace license files for self-hosted team workspaces via a new modal dialog.
  - Introduced clearer UI flows for activating, deactivating, and managing team licenses, including one-time purchase licenses.
  - Provided direct links and guidance for requesting licenses and managing payments.

- **Enhancements**
  - Improved license management interface with updated button labels and descriptions.
  - Added new styles for better layout and clarity in license dialogs.
  - Updated internationalization with new and revised texts for license operations.

- **Bug Fixes**
  - Prevented duplicate opening of license or plan dialogs when already open.

- **Chores**
  - Updated support and pricing links for clarity and accuracy.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-27 04:56:14 +00:00

84 lines
2.4 KiB
TypeScript

import { buttonVariants } from '@affine/admin/components/ui/button';
import { Separator } from '@affine/admin/components/ui/separator';
import { cn } from '@affine/admin/utils';
import {
AlbumIcon,
ChevronRightIcon,
GithubIcon,
MailWarningIcon,
UploadCloudIcon,
} from 'lucide-react';
type Channel = 'stable' | 'canary' | 'beta' | 'internal';
const appNames = {
stable: 'AFFiNE',
canary: 'AFFiNE Canary',
beta: 'AFFiNE Beta',
internal: 'AFFiNE Internal',
} satisfies Record<Channel, string>;
const appName = appNames[BUILD_CONFIG.appBuildType];
const links = [
{
href: BUILD_CONFIG.githubUrl,
icon: <GithubIcon size={20} />,
label: 'Star AFFiNE on GitHub',
},
{
href: BUILD_CONFIG.githubUrl,
icon: <MailWarningIcon size={20} />,
label: 'Report an Issue',
},
{
href: 'https://docs.affine.pro/docs/self-host-affine',
icon: <AlbumIcon size={20} />,
label: 'Self-host Document',
},
{
href: 'https://affine.pro/pricing/?type=selfhost#table',
icon: <UploadCloudIcon size={20} />,
label: 'Upgrade to Team',
},
];
export function AboutAFFiNE() {
return (
<div className="flex flex-col h-full gap-3 py-5 px-6 w-full">
<div className="flex items-center">
<span className="text-xl font-semibold">About AFFiNE</span>
</div>
<div className="overflow-y-auto space-y-[10px]">
<div className="flex flex-col rounded-md border">
{links.map(({ href, icon, label }, index) => (
<div key={label + index}>
<a
className={cn(
buttonVariants({ variant: 'ghost' }),
'justify-between cursor-pointer w-full'
)}
href={href}
target="_blank"
rel="noreferrer"
>
<div className="flex items-center gap-3">
{icon}
<span>{label}</span>
</div>
<div>
<ChevronRightIcon size={20} />
</div>
</a>
{index < links.length - 1 && <Separator />}
</div>
))}
</div>
</div>
<div className="space-y-3 text-sm font-normal text-gray-500">
<div>{`App Version: ${appName} ${BUILD_CONFIG.appVersion}`}</div>
<div>{`Editor Version: ${BUILD_CONFIG.editorVersion}`}</div>
</div>
</div>
);
}