mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
@@ -23,7 +23,7 @@ export type WorkspaceSettingDetailProps = {
|
||||
onDeleteWorkspace: (id: string) => Promise<void>;
|
||||
onTransferWorkspace: <
|
||||
From extends WorkspaceFlavour,
|
||||
To extends WorkspaceFlavour
|
||||
To extends WorkspaceFlavour,
|
||||
>(
|
||||
from: From,
|
||||
to: To,
|
||||
|
||||
@@ -35,7 +35,7 @@ import * as styles from './styles.css';
|
||||
import { OSWarningMessage, shouldShowWarning } from './utils';
|
||||
|
||||
export type BaseHeaderProps<
|
||||
Workspace extends AffineOfficialWorkspace = AffineOfficialWorkspace
|
||||
Workspace extends AffineOfficialWorkspace = AffineOfficialWorkspace,
|
||||
> = {
|
||||
workspace: Workspace;
|
||||
currentPage: Page | null;
|
||||
|
||||
@@ -16,10 +16,13 @@ export const FavoriteList = ({ currentWorkspace }: FavoriteListProps) => {
|
||||
|
||||
const metaMapping = useMemo(
|
||||
() =>
|
||||
metas.reduce((acc, meta) => {
|
||||
acc[meta.id] = meta;
|
||||
return acc;
|
||||
}, {} as Record<string, PageMeta>),
|
||||
metas.reduce(
|
||||
(acc, meta) => {
|
||||
acc[meta.id] = meta;
|
||||
return acc;
|
||||
},
|
||||
{} as Record<string, PageMeta>
|
||||
),
|
||||
[metas]
|
||||
);
|
||||
|
||||
|
||||
@@ -56,22 +56,22 @@ export const StyledNewPageButton = styled('button')(() => {
|
||||
},
|
||||
};
|
||||
});
|
||||
export const StyledSliderModalBackground = styled('div')<{ active: boolean }>(
|
||||
({ active }) => {
|
||||
return {
|
||||
transition: 'opacity .15s',
|
||||
pointerEvents: active ? 'auto' : 'none',
|
||||
opacity: active ? 1 : 0,
|
||||
position: 'fixed',
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: active ? 0 : '100%',
|
||||
bottom: 0,
|
||||
zIndex: parseInt(baseTheme.zIndexModal) - 1,
|
||||
background: 'var(--affine-background-modal-color)',
|
||||
};
|
||||
}
|
||||
);
|
||||
export const StyledSliderModalBackground = styled('div')<{ active: boolean }>(({
|
||||
active,
|
||||
}) => {
|
||||
return {
|
||||
transition: 'opacity .15s',
|
||||
pointerEvents: active ? 'auto' : 'none',
|
||||
opacity: active ? 1 : 0,
|
||||
position: 'fixed',
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: active ? 0 : '100%',
|
||||
bottom: 0,
|
||||
zIndex: parseInt(baseTheme.zIndexModal) - 1,
|
||||
background: 'var(--affine-background-modal-color)',
|
||||
};
|
||||
});
|
||||
|
||||
export const StyledScrollWrapper = styled('div')<{
|
||||
showTopBorder: boolean;
|
||||
|
||||
@@ -6,7 +6,7 @@ import { useAtom } from 'jotai';
|
||||
*/
|
||||
export function useCurrentPageId(): [
|
||||
string | null,
|
||||
(newId: string | null) => void
|
||||
(newId: string | null) => void,
|
||||
] {
|
||||
return useAtom(rootCurrentPageIdAtom);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import type { AllWorkspace } from '../../shared';
|
||||
|
||||
export function useCurrentWorkspace(): [
|
||||
AllWorkspace,
|
||||
(id: string | null) => void
|
||||
(id: string | null) => void,
|
||||
] {
|
||||
const currentWorkspace = useAtomValue(rootCurrentWorkspaceAtom);
|
||||
const [, setId] = useAtom(rootCurrentWorkspaceIdAtom);
|
||||
|
||||
Reference in New Issue
Block a user