mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-22 20:46:38 +08:00
fix: whiteboard -> edgeless
This commit is contained in:
@@ -4,7 +4,7 @@ import { StatusText } from './StatusText';
|
||||
import { StatusTrack } from './StatusTrack';
|
||||
import { DocMode } from './type';
|
||||
|
||||
const isBoard = (pathname: string): boolean => pathname.endsWith('/whiteboard');
|
||||
const isBoard = (pathname: string): boolean => pathname.endsWith('/edgeless');
|
||||
|
||||
export const Switcher = () => {
|
||||
const navigate = useNavigate();
|
||||
@@ -20,11 +20,11 @@ export const Switcher = () => {
|
||||
/**
|
||||
* There are two possible modes:
|
||||
* Page mode: /{workspaceId}/{pageId}
|
||||
* Board mode: /{workspaceId}/{pageId}/whiteboard
|
||||
* Board mode: /{workspaceId}/{pageId}/edgeless
|
||||
*/
|
||||
const pageId = params['*'].split('/')[0];
|
||||
const targetUrl = `/${workspaceId}/${pageId}${
|
||||
targetViewMode === DocMode.board ? '/whiteboard' : ''
|
||||
targetViewMode === DocMode.board ? '/edgeless' : ''
|
||||
}`;
|
||||
navigate(targetUrl);
|
||||
};
|
||||
|
||||
@@ -26,7 +26,7 @@ function hideAffineHeader(pathname: string): boolean {
|
||||
}
|
||||
|
||||
type HeaderIconProps = {
|
||||
isWhiteboardView?: boolean;
|
||||
isEdgelessView?: boolean;
|
||||
};
|
||||
|
||||
export const AffineHeader = () => {
|
||||
@@ -38,7 +38,7 @@ export const AffineHeader = () => {
|
||||
const { toggleSettingsSidebar: toggleInfoSidebar } =
|
||||
useShowSettingsSidebar();
|
||||
const theme = useTheme();
|
||||
const isWhiteboardView = pathname.endsWith('/whiteboard');
|
||||
const isEdgelessView = pathname.endsWith('/edgeless');
|
||||
const pageHistoryPortalFlag = useFlag('BooleanPageHistoryPortal', false);
|
||||
const pageSettingPortalFlag = useFlag('PageSettingPortal', false);
|
||||
const BooleanPageSharePortal = useFlag('BooleanPageSharePortal', false);
|
||||
@@ -77,9 +77,9 @@ export const AffineHeader = () => {
|
||||
<Tooltip content="Doc">
|
||||
<HeaderIcon
|
||||
style={{ width: '80px' }}
|
||||
isWhiteboardView={!isWhiteboardView}
|
||||
isEdgelessView={!isEdgelessView}
|
||||
onClick={() =>
|
||||
isWhiteboardView
|
||||
isEdgelessView
|
||||
? navigate(
|
||||
`/${
|
||||
params['workspace_id'] ||
|
||||
@@ -100,17 +100,17 @@ export const AffineHeader = () => {
|
||||
</span>
|
||||
</HeaderIcon>
|
||||
</Tooltip>
|
||||
<Tooltip content="Whiteboard">
|
||||
<Tooltip content="Edgeless">
|
||||
<HeaderIcon
|
||||
isWhiteboardView={isWhiteboardView}
|
||||
isEdgelessView={isEdgelessView}
|
||||
onClick={() =>
|
||||
isWhiteboardView
|
||||
isEdgelessView
|
||||
? null
|
||||
: navigate(
|
||||
`/${
|
||||
params['workspace_id'] ||
|
||||
'space'
|
||||
}/${params['*']}` + '/whiteboard'
|
||||
}/${params['*']}` + '/edgeless'
|
||||
)
|
||||
}
|
||||
>
|
||||
@@ -166,14 +166,14 @@ const StyledHeaderRight = styled('div')`
|
||||
`;
|
||||
|
||||
const HeaderIcon = styled(IconButton, {
|
||||
shouldForwardProp: (prop: string) => prop !== 'isWhiteboardView',
|
||||
})<HeaderIconProps>(({ isWhiteboardView = false }) => ({
|
||||
shouldForwardProp: (prop: string) => prop !== 'isEdgelessView',
|
||||
})<HeaderIconProps>(({ isEdgelessView = false }) => ({
|
||||
color: '#98ACBD',
|
||||
minWidth: 48,
|
||||
width: 48,
|
||||
height: 36,
|
||||
borderRadius: '8px',
|
||||
...(isWhiteboardView && {
|
||||
...(isEdgelessView && {
|
||||
color: '#fff',
|
||||
backgroundColor: '#3E6FDB',
|
||||
'&:hover': {
|
||||
|
||||
Reference in New Issue
Block a user