refactor: avoid runtime config object (#8202)

This commit is contained in:
forehalo
2024-09-13 07:27:11 +00:00
parent c76b4d70b0
commit 25969a34e8
45 changed files with 117 additions and 156 deletions

View File

@@ -20,15 +20,16 @@ const appNames = {
beta: 'AFFiNE Beta',
internal: 'AFFiNE Internal',
} satisfies Record<Channel, string>;
const appName = appNames[BUILD_CONFIG.appBuildType];
const links = [
{
href: runtimeConfig.githubUrl,
href: BUILD_CONFIG.githubUrl,
icon: <GithubIcon size={20} />,
label: 'Star AFFiNE on GitHub',
},
{
href: runtimeConfig.githubUrl,
href: BUILD_CONFIG.githubUrl,
icon: <MailWarningIcon size={20} />,
label: 'Report an Issue',
},
@@ -45,9 +46,6 @@ const links = [
];
export function AboutAFFiNE() {
const { appBuildType, appVersion, editorVersion } = runtimeConfig;
const appName = appNames[appBuildType];
return (
<div className="flex flex-col h-full gap-3 py-5 px-6 w-full">
<div className="flex items-center">
@@ -80,8 +78,8 @@ export function AboutAFFiNE() {
</div>
</div>
<div className="space-y-3 text-sm font-normal text-gray-500">
<div>{`App Version: ${appName} ${appVersion}`}</div>
<div>{`Editor Version: ${editorVersion}`}</div>
<div>{`App Version: ${appName} ${BUILD_CONFIG.appVersion}`}</div>
<div>{`Editor Version: ${BUILD_CONFIG.editorVersion}`}</div>
</div>
</div>
);