mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 04:48:53 +00:00
feat(infra): framework
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { apis } from '@affine/electron-api';
|
||||
import { fetchWithTraceReport } from '@affine/graphql';
|
||||
import { ArrowRightSmallIcon } from '@blocksuite/icons';
|
||||
import clsx from 'clsx';
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
@@ -112,7 +111,7 @@ export const OnboardingPage = ({
|
||||
const [questionIdx, setQuestionIdx] = useState(0);
|
||||
const { data: questions } = useSWR<Question[]>(
|
||||
'/api/worker/questionnaire',
|
||||
url => fetchWithTraceReport(url).then(r => r.json()),
|
||||
url => fetch(url).then(r => r.json()),
|
||||
{ suspense: true, revalidateOnFocus: false }
|
||||
);
|
||||
const [options, setOptions] = useState(new Set<string>());
|
||||
@@ -242,7 +241,7 @@ export const OnboardingPage = ({
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
fetchWithTraceReport('/api/worker/questionnaire', {
|
||||
fetch('/api/worker/questionnaire', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(answer),
|
||||
}).finally(() => {
|
||||
|
||||
@@ -7,11 +7,10 @@ import { Button } from '../../ui/button';
|
||||
import { notify } from '../../ui/notification';
|
||||
import { AuthPageContainer } from './auth-page-container';
|
||||
import { SetPassword } from './set-password';
|
||||
import type { User } from './type';
|
||||
|
||||
export const SignUpPage: FC<{
|
||||
passwordLimits: PasswordLimitsFragment;
|
||||
user: User;
|
||||
user: { email?: string };
|
||||
onSetPassword: (password: string) => Promise<void>;
|
||||
openButtonText?: string;
|
||||
onOpenAffine: () => void;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export interface User {
|
||||
id: string;
|
||||
name: string;
|
||||
email: string;
|
||||
label: string;
|
||||
email?: string;
|
||||
image?: string | null;
|
||||
avatarUrl: string | null;
|
||||
avatar?: string | null;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ export const NoPermissionOrNotFound = ({
|
||||
</Button>
|
||||
</div>
|
||||
<div className={wrapper}>
|
||||
<Avatar url={user.avatarUrl ?? user.image} name={user.name} />
|
||||
<Avatar url={user.avatar ?? user.image} name={user.label} />
|
||||
<span style={{ margin: '0 12px' }}>{user.email}</span>
|
||||
<Tooltip content={t['404.signOut']()}>
|
||||
<IconButton onClick={onSignOut}>
|
||||
@@ -91,7 +91,7 @@ export const NotFoundPage = ({
|
||||
|
||||
{user ? (
|
||||
<div className={wrapper}>
|
||||
<Avatar url={user.avatarUrl ?? user.image} name={user.name} />
|
||||
<Avatar url={user.avatar ?? user.image} name={user.label} />
|
||||
<span style={{ margin: '0 12px' }}>{user.email}</span>
|
||||
<Tooltip content={t['404.signOut']()}>
|
||||
<IconButton onClick={onSignOut}>
|
||||
|
||||
@@ -175,7 +175,7 @@ export const ResizePanel = forwardRef<HTMLDivElement, ResizePanelProps>(
|
||||
data-handle-position={resizeHandlePos}
|
||||
data-enable-animation={enableAnimation && !resizing}
|
||||
>
|
||||
{children}
|
||||
{status !== 'exited' && children}
|
||||
<ResizeHandle
|
||||
resizeHandlePos={resizeHandlePos}
|
||||
resizeHandleOffset={resizeHandleOffset}
|
||||
|
||||
@@ -24,7 +24,9 @@ export interface WorkspaceListProps {
|
||||
onSettingClick: (workspace: WorkspaceMetadata) => void;
|
||||
onEnableCloudClick?: (meta: WorkspaceMetadata) => void;
|
||||
onDragEnd: (event: DragEndEvent) => void;
|
||||
useIsWorkspaceOwner: (workspaceMetadata: WorkspaceMetadata) => boolean;
|
||||
useIsWorkspaceOwner: (
|
||||
workspaceMetadata: WorkspaceMetadata
|
||||
) => boolean | undefined;
|
||||
useWorkspaceAvatar: (
|
||||
workspaceMetadata: WorkspaceMetadata
|
||||
) => string | undefined;
|
||||
|
||||
Reference in New Issue
Block a user