diff --git a/frontend/appflowy_web_app/src/application/types.ts b/frontend/appflowy_web_app/src/application/types.ts index d9d89d080c..7d05735d14 100644 --- a/frontend/appflowy_web_app/src/application/types.ts +++ b/frontend/appflowy_web_app/src/application/types.ts @@ -59,4 +59,5 @@ export interface View { layout: ViewLayout; extra: ViewExtra | null; children: View[]; + is_published: boolean; } \ No newline at end of file diff --git a/frontend/appflowy_web_app/src/assets/login/apple.svg b/frontend/appflowy_web_app/src/assets/login/apple.svg index eefe3371a1..9be1f9f0c9 100644 --- a/frontend/appflowy_web_app/src/assets/login/apple.svg +++ b/frontend/appflowy_web_app/src/assets/login/apple.svg @@ -1,4 +1,4 @@ - diff --git a/frontend/appflowy_web_app/src/components/login/LoginProvider.tsx b/frontend/appflowy_web_app/src/components/login/LoginProvider.tsx index 72e076002a..1ac590d390 100644 --- a/frontend/appflowy_web_app/src/components/login/LoginProvider.tsx +++ b/frontend/appflowy_web_app/src/components/login/LoginProvider.tsx @@ -67,28 +67,32 @@ function LoginProvider ({ redirectTo }: { redirectTo: string }) { variant={'outlined'} onClick={() => handleClick(option.value)} className={ - `flex h-[46px] w-[380px] items-center justify-center gap-[10px] rounded-[12px] border border-line-divider text-sm font-medium max-sm:w-full ${option.value === 'apple' ? 'text-black bg-white hover:bg-fill-list-hover' : 'text-text-title'}` + `flex h-[46px] w-[380px] items-center justify-center gap-[10px] rounded-[12px] border border-line-divider text-sm font-medium max-sm:w-full text-text-title` } > - - {option.label} + +
{option.label}
+ ; }, [handleClick]); return (
{options.slice(0, 2).map(renderOption)} - - {options.slice(2).map(renderOption)} + } + + +
{options.slice(2).map(renderOption)}
+
); } diff --git a/frontend/appflowy_web_app/src/components/publish/outline/OutlineItem.tsx b/frontend/appflowy_web_app/src/components/publish/outline/OutlineItem.tsx index e6489be326..8984387d08 100644 --- a/frontend/appflowy_web_app/src/components/publish/outline/OutlineItem.tsx +++ b/frontend/appflowy_web_app/src/components/publish/outline/OutlineItem.tsx @@ -53,6 +53,17 @@ function OutlineItem ({ view, level = 0, width }: { view: View; width: number; l const { t } = useTranslation(); const navigateToView = useContext(PublishContext)?.toView; + + const toastWarning = useCallback((item: View) => { + if (!item.is_published) { + if (item.extra?.is_space) { + notify.warning(t('publish.spaceHasNotBeenPublished')); + return; + } + + notify.warning(t('publish.hasNotBeenPublished')); + } + }, [t]); const renderItem = (item: View) => { const { icon, layout, name, view_id, extra } = item; @@ -72,15 +83,15 @@ function OutlineItem ({ view, level = 0, width }: { view: View; width: number; l {item.children?.length ? getIcon() : null}
{ + if (!item.is_published) { + toastWarning(item); + return; + } + try { await navigateToView?.(view_id); } catch (e) { - if (isSpace) { - notify.warning(t('publish.spaceHasNotBeenPublished')); - return; - } - - notify.warning(t('publish.hasNotBeenPublished')); + toastWarning(item); } }} style={{ diff --git a/frontend/resources/translations/en.json b/frontend/resources/translations/en.json index 3a93a07584..9bc9806f09 100644 --- a/frontend/resources/translations/en.json +++ b/frontend/resources/translations/en.json @@ -2414,7 +2414,7 @@ "continueWithGoogle": "Continue with Google", "continueWithGithub": "Continue with GitHub", "continueWithDiscord": "Continue with Discord", - "continueWithApple": "Continue with Apple", + "continueWithApple": "Continue with Apple ", "moreOptions": "More options", "collapse": "Collapse", "signInAgreement": "By clicking \"Continue\" above, you agreed to AppFlowy's",