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: apple login on web (#6213)

Kilu.Hea1bc9246b12b
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 @@
-<svg fill="#000000" height="800px" width="800px" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg"
+<svg fill="currentColor" height="800px" width="800px" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 22.773 22.773" xml:space="preserve">
<g>
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.Icon className={'h-[20px] w-[20px]'} />
- {option.label}
+ <option.Icon className={'w-[24px] h-[24px]'} />
+ <div className={'w-auto whitespace-pre'}>{option.label}</div>
+
</Button>;
}, [handleClick]);
return (
<div className={'flex w-full flex-col items-center justify-center gap-[10px]'}>
{options.slice(0, 2).map(renderOption)}
- <Button
+ {!expand && <Button
color={'inherit'}
size={'small'}
onClick={() => setExpand(!expand)}
className={'text-sm w-full flex gap-2 items-center hover:bg-transparent hover:text-text-title font-medium text-text-caption'}
>
<Divider className={'flex-1'} />
- {expand ? t('web.collapse') : t('web.moreOptions')}
+ {t('web.moreOptions')}
<Divider className={'flex-1'} />
- </Button>
- <Collapse in={expand}>{options.slice(2).map(renderOption)}</Collapse>
+ </Button>}
+
+ <Collapse in={expand}>
+ <div className={'gap-[10px] flex-col flex'}>{options.slice(2).map(renderOption)}</div>
+ </Collapse>
</div>
);
}
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}
<div
onClick={async () => {
+ 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",