From 6ea20e477bca00be0b6c661d03889b21fbb82a06 Mon Sep 17 00:00:00 2001
From: JimmFly <447268514@qq.com>
Date: Wed, 10 Apr 2024 07:27:02 +0000
Subject: [PATCH] feat(core): add sign in to not found page (#6496)
close AFF-211
---
.../affine-other-page-layout/index.css.ts | 25 ++++-
.../affine-other-page-layout/layout.tsx | 36 +++---
.../mobile-navbar.tsx | 2 +-
.../auth-components/auth-page-container.tsx | 20 +---
.../components/auth-components/share.css.ts | 16 ++-
.../not-found-page/not-found-page.tsx | 105 +++++++++++++-----
.../components/not-found-page/styles.css.ts | 2 +-
.../component/src/ui/empty/empty-svg.tsx | 10 +-
.../frontend/component/src/ui/empty/empty.tsx | 22 +++-
.../component/src/ui/empty/index.css.ts | 24 ++++
.../frontend/component/src/ui/empty/style.ts | 19 ----
.../components/workspace-upgrade/upgrade.tsx | 15 +--
packages/frontend/core/src/pages/404.tsx | 38 +++++--
packages/frontend/core/src/pages/sign-in.tsx | 31 ++++--
.../workspace/detail-page/detail-page.tsx | 2 +-
.../core/src/pages/workspace/index.tsx | 3 +-
16 files changed, 245 insertions(+), 125 deletions(-)
create mode 100644 packages/frontend/component/src/ui/empty/index.css.ts
delete mode 100644 packages/frontend/component/src/ui/empty/style.ts
diff --git a/packages/frontend/component/src/components/affine-other-page-layout/index.css.ts b/packages/frontend/component/src/components/affine-other-page-layout/index.css.ts
index 863abcabd9..bffdf0e7f0 100644
--- a/packages/frontend/component/src/components/affine-other-page-layout/index.css.ts
+++ b/packages/frontend/component/src/components/affine-other-page-layout/index.css.ts
@@ -17,11 +17,12 @@ export const topNav = style({
left: 0,
right: 0,
display: 'flex',
+ position: 'fixed',
alignItems: 'center',
justifyContent: 'space-between',
padding: '16px 120px',
- selectors: {
- '&.mobile': {
+ '@media': {
+ 'screen and (max-width: 1024px)': {
padding: '16px 20px',
},
},
@@ -29,6 +30,11 @@ export const topNav = style({
export const topNavLinks = style({
display: 'flex',
columnGap: 4,
+ '@media': {
+ 'screen and (max-width: 1024px)': {
+ display: 'none',
+ },
+ },
});
export const topNavLink = style({
color: cssVar('textPrimaryColor'),
@@ -46,6 +52,21 @@ export const iconButton = style({
},
},
});
+export const hideInWideScreen = style({
+ '@media': {
+ 'screen and (min-width: 1024px)': {
+ display: 'none',
+ position: 'absolute',
+ },
+ },
+});
+export const hideInSmallScreen = style({
+ '@media': {
+ 'screen and (max-width: 1024px)': {
+ display: 'none',
+ },
+ },
+});
export const menu = style({
width: '100vw',
height: '100vh',
diff --git a/packages/frontend/component/src/components/affine-other-page-layout/layout.tsx b/packages/frontend/component/src/components/affine-other-page-layout/layout.tsx
index c58891324c..f5128aad39 100644
--- a/packages/frontend/component/src/components/affine-other-page-layout/layout.tsx
+++ b/packages/frontend/component/src/components/affine-other-page-layout/layout.tsx
@@ -1,7 +1,6 @@
import { Button } from '@affine/component/ui/button';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { Logo1Icon } from '@blocksuite/icons';
-import clsx from 'clsx';
import { useCallback } from 'react';
import { DesktopNavbar } from './desktop-navbar';
@@ -9,10 +8,8 @@ import * as styles from './index.css';
import { MobileNavbar } from './mobile-navbar';
export const AffineOtherPageLayout = ({
- isSmallScreen,
children,
}: {
- isSmallScreen: boolean;
children: React.ReactNode;
}) => {
const t = useAFFiNEI18N();
@@ -23,25 +20,22 @@ export const AffineOtherPageLayout = ({
return (
-
-
-
-
- {isSmallScreen ? (
+ {environment.isDesktop ? null : (
+
+
+
+
+
+
+
- ) : (
- <>
-
-
- >
- )}
-
+
+ )}
{children}
diff --git a/packages/frontend/component/src/components/affine-other-page-layout/mobile-navbar.tsx b/packages/frontend/component/src/components/affine-other-page-layout/mobile-navbar.tsx
index 1d544b27fd..5cebda88d7 100644
--- a/packages/frontend/component/src/components/affine-other-page-layout/mobile-navbar.tsx
+++ b/packages/frontend/component/src/components/affine-other-page-layout/mobile-navbar.tsx
@@ -29,7 +29,7 @@ export const MobileNavbar = () => {
);
return (
-
+