Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

fix: modified some behavior of template (#6242)

Kilu.He3caf84b8a092
diff --git a/frontend/appflowy_web_app/src/application/publish/context.tsx b/frontend/appflowy_web_app/src/application/publish/context.tsx
index f75dda3b97..aebfd10f92 100644
--- a/frontend/appflowy_web_app/src/application/publish/context.tsx
+++ b/frontend/appflowy_web_app/src/application/publish/context.tsx
@@ -12,6 +12,7 @@ import { useNavigate } from 'react-router-dom';
export interface PublishContextType {
namespace: string;
publishName: string;
+ isTemplate?: boolean;
isTemplateThumb?: boolean;
viewMeta?: ViewMeta;
toView: (viewId: string) => Promise<void>;
@@ -28,11 +29,13 @@ export const PublishProvider = ({
namespace,
publishName,
isTemplateThumb,
+ isTemplate,
}: {
children: React.ReactNode;
namespace: string;
publishName: string;
isTemplateThumb?: boolean;
+ isTemplate?: boolean;
}) => {
const [outline, setOutline] = useState<View>();
@@ -102,7 +105,7 @@ export const PublishProvider = ({
const { namespace: viewNamespace, publishName } = res;
prevViewMeta.current = undefined;
- navigate(`/${viewNamespace}/${publishName}`, {
+ navigate(`/${viewNamespace}/${publishName}${isTemplate ? '?template=true' : ''}`, {
replace: true,
});
return;
@@ -110,7 +113,7 @@ export const PublishProvider = ({
return Promise.reject(e);
}
},
- [navigate, service],
+ [navigate, service, isTemplate],
);
const loadOutline = useCallback(async () => {
diff --git a/frontend/appflowy_web_app/src/components/global-comment/index.ts b/frontend/appflowy_web_app/src/components/global-comment/index.ts
index 0f422a88f5..bd3b5178a4 100644
--- a/frontend/appflowy_web_app/src/components/global-comment/index.ts
+++ b/frontend/appflowy_web_app/src/components/global-comment/index.ts
@@ -1 +1,3 @@
-export * from './GlobalCommentProvider';
+import { lazy } from 'react';
+
+export const GlobalCommentProvider = lazy(() => import('./GlobalCommentProvider'));
diff --git a/frontend/appflowy_web_app/src/components/publish/PublishView.tsx b/frontend/appflowy_web_app/src/components/publish/PublishView.tsx
index 56001bafb9..84c06aa71f 100644
--- a/frontend/appflowy_web_app/src/components/publish/PublishView.tsx
+++ b/frontend/appflowy_web_app/src/components/publish/PublishView.tsx
@@ -88,7 +88,10 @@ export function PublishView ({ namespace, publishName }: PublishViewProps) {
}
return (
- <PublishProvider isTemplateThumb={isTemplateThumb} namespace={namespace} publishName={publishName}>
+ <PublishProvider
+ isTemplateThumb={isTemplateThumb} isTemplate={isTemplate} namespace={namespace}
+ publishName={publishName}
+ >
<div className={'h-screen w-screen'} style={isTemplateThumb ? {
pointerEvents: 'none',
transform: 'scale(0.333)',
diff --git a/frontend/appflowy_web_app/src/styles/variables/light.variables.css b/frontend/appflowy_web_app/src/styles/variables/light.variables.css
index 771166228c..0fc95cb30e 100644
--- a/frontend/appflowy_web_app/src/styles/variables/light.variables.css
+++ b/frontend/appflowy_web_app/src/styles/variables/light.variables.css
@@ -13,7 +13,7 @@
--icon-disabled: #e0e0e0;
--icon-on-toolbar: #ffffff;
--line-border: #bdbdbd;
- --line-divider: #e5e5e5;
+ --line-divider: #1F232923;
--line-on-toolbar: #4f4f4f;
--fill-toolbar: #333333;
--fill-default: #00bcf0;