mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 20:38:52 +00:00
chore: enable no-unused vars (#2181)
This commit is contained in:
@@ -38,7 +38,6 @@ export type OperationCellProps = {
|
||||
|
||||
export const OperationCell: React.FC<OperationCellProps> = ({
|
||||
pageMeta,
|
||||
metas,
|
||||
blockSuiteWorkspace,
|
||||
onOpenPageInNewTab,
|
||||
onToggleFavoritePage,
|
||||
|
||||
@@ -12,7 +12,7 @@ export const StyledTableContainer = styled('div')(({ theme }) => {
|
||||
},
|
||||
};
|
||||
});
|
||||
export const StyledTitleWrapper = styled('div')(({ theme }) => {
|
||||
export const StyledTitleWrapper = styled('div')(() => {
|
||||
return {
|
||||
...displayFlex('flex-start', 'center'),
|
||||
a: {
|
||||
@@ -26,7 +26,7 @@ export const StyledTitleWrapper = styled('div')(({ theme }) => {
|
||||
},
|
||||
};
|
||||
});
|
||||
export const StyledTitleLink = styled('div')(({ theme }) => {
|
||||
export const StyledTitleLink = styled('div')(() => {
|
||||
return {
|
||||
maxWidth: '80%',
|
||||
marginRight: '18px',
|
||||
|
||||
@@ -3,7 +3,7 @@ import { displayFlex, styled } from '@affine/component';
|
||||
export const StyledEditorModeSwitch = styled('div')<{
|
||||
switchLeft: boolean;
|
||||
showAlone?: boolean;
|
||||
}>(({ theme, switchLeft, showAlone }) => {
|
||||
}>(({ switchLeft, showAlone }) => {
|
||||
return {
|
||||
width: showAlone ? '40px' : '78px',
|
||||
height: '32px',
|
||||
|
||||
@@ -26,7 +26,7 @@ export default EditPage;
|
||||
const StyledEditPageButton = styled(
|
||||
TextButton,
|
||||
{}
|
||||
)(({ theme }) => {
|
||||
)(() => {
|
||||
return {
|
||||
border: '1px solid var(--affine-primary-color)',
|
||||
color: 'var(--affine-primary-color)',
|
||||
|
||||
@@ -76,12 +76,12 @@ const LocalHeaderShareMenu: React.FC<BaseHeaderProps> = props => {
|
||||
},
|
||||
[helper]
|
||||
)}
|
||||
togglePagePublic={useCallback(async (page, isPublic) => {
|
||||
togglePagePublic={useCallback(async () => {
|
||||
// local workspace should not have public page
|
||||
throw new Error('unreachable');
|
||||
}, [])}
|
||||
toggleWorkspacePublish={useCallback(
|
||||
async (workspace, publish) => {
|
||||
async workspace => {
|
||||
assertEquals(workspace.flavour, WorkspaceFlavour.LOCAL);
|
||||
assertEquals(workspace.id, props.workspace.id);
|
||||
await helper.jumpToSubPath(workspace.id, WorkspaceSubPath.SETTING);
|
||||
|
||||
@@ -23,7 +23,7 @@ import { affineAuth } from '../../../../plugins/affine';
|
||||
import type { AffineOfficialWorkspace } from '../../../../shared';
|
||||
import { TransformWorkspaceToAffineModal } from '../../../affine/transform-workspace-to-affine-modal';
|
||||
|
||||
const IconWrapper = styled('div')(({ theme }) => {
|
||||
const IconWrapper = styled('div')(() => {
|
||||
return {
|
||||
width: '32px',
|
||||
height: '32px',
|
||||
|
||||
@@ -4,7 +4,7 @@ import spring, { toString } from 'css-spring';
|
||||
|
||||
const ANIMATE_DURATION = 400;
|
||||
|
||||
export const StyledThemeModeSwitch = styled('button')(({ theme }) => {
|
||||
export const StyledThemeModeSwitch = styled('button')(() => {
|
||||
return {
|
||||
width: '32px',
|
||||
height: '32px',
|
||||
@@ -20,7 +20,7 @@ export const StyledThemeModeSwitch = styled('button')(({ theme }) => {
|
||||
export const StyledSwitchItem = styled('div')<{
|
||||
active: boolean;
|
||||
isHover: boolean;
|
||||
}>(({ active, isHover, theme }) => {
|
||||
}>(({ active, isHover }) => {
|
||||
const activeRaiseAnimate = toString(
|
||||
spring({ top: '0' }, { top: '-100%' }, { preset: 'gentle' })
|
||||
);
|
||||
|
||||
@@ -106,19 +106,19 @@ const HeaderRightItems: Record<HeaderRightItemName, HeaderItem> = {
|
||||
},
|
||||
[HeaderRightItemName.ShareMenu]: {
|
||||
Component: HeaderShareMenu,
|
||||
availableWhen: (workspace, currentPage, { isPublic, isPreview }) => {
|
||||
availableWhen: (workspace, currentPage) => {
|
||||
return workspace.flavour !== WorkspaceFlavour.PUBLIC && !!currentPage;
|
||||
},
|
||||
},
|
||||
[HeaderRightItemName.EditPage]: {
|
||||
Component: EditPage,
|
||||
availableWhen: (workspace, currentPage, { isPublic, isPreview }) => {
|
||||
availableWhen: (workspace, currentPage, { isPublic }) => {
|
||||
return isPublic;
|
||||
},
|
||||
},
|
||||
[HeaderRightItemName.UserAvatar]: {
|
||||
Component: UserAvatar,
|
||||
availableWhen: (workspace, currentPage, { isPublic, isPreview }) => {
|
||||
availableWhen: (workspace, currentPage, { isPublic }) => {
|
||||
return isPublic;
|
||||
},
|
||||
},
|
||||
|
||||
@@ -23,22 +23,20 @@ export const StyledHeaderContainer = styled('div')<{
|
||||
},
|
||||
};
|
||||
});
|
||||
export const StyledHeader = styled('div')<{ hasWarning: boolean }>(
|
||||
({ theme }) => {
|
||||
return {
|
||||
flexShrink: 0,
|
||||
height: '52px',
|
||||
width: '100%',
|
||||
padding: '0 20px',
|
||||
...displayFlex('space-between', 'center'),
|
||||
background: 'var(--affine-background-primary-color)',
|
||||
zIndex: 99,
|
||||
position: 'relative',
|
||||
};
|
||||
}
|
||||
);
|
||||
export const StyledHeader = styled('div')<{ hasWarning: boolean }>(() => {
|
||||
return {
|
||||
flexShrink: 0,
|
||||
height: '52px',
|
||||
width: '100%',
|
||||
padding: '0 20px',
|
||||
...displayFlex('space-between', 'center'),
|
||||
background: 'var(--affine-background-primary-color)',
|
||||
zIndex: 99,
|
||||
position: 'relative',
|
||||
};
|
||||
});
|
||||
|
||||
export const StyledTitleContainer = styled('div')(({ theme }) => ({
|
||||
export const StyledTitleContainer = styled('div')(() => ({
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
|
||||
@@ -82,7 +80,7 @@ export const StyledHeaderRightSide = styled('div')({
|
||||
});
|
||||
|
||||
export const StyledBrowserWarning = styled('div')<{ show: boolean }>(
|
||||
({ theme, show }) => {
|
||||
({ show }) => {
|
||||
return {
|
||||
backgroundColor: 'var(--affine-background-warning-color)',
|
||||
color: 'var(--affine-background-warning-color)',
|
||||
@@ -95,7 +93,7 @@ export const StyledBrowserWarning = styled('div')<{ show: boolean }>(
|
||||
}
|
||||
);
|
||||
|
||||
export const StyledCloseButton = styled('div')(({ theme }) => {
|
||||
export const StyledCloseButton = styled('div')(() => {
|
||||
return {
|
||||
width: '36px',
|
||||
height: '36px',
|
||||
@@ -137,7 +135,7 @@ export const StyledSearchArrowWrapper = styled('div')(() => {
|
||||
};
|
||||
});
|
||||
|
||||
export const StyledPageListTittleWrapper = styled(StyledTitle)(({ theme }) => {
|
||||
export const StyledPageListTittleWrapper = styled(StyledTitle)(() => {
|
||||
return {
|
||||
fontSize: 'var(--affine-font-base)',
|
||||
color: 'var(--affine-text-primary-color)',
|
||||
@@ -148,7 +146,7 @@ export const StyledPageListTittleWrapper = styled(StyledTitle)(({ theme }) => {
|
||||
},
|
||||
};
|
||||
});
|
||||
export const StyledQuickSearchTipButton = styled('div')(({ theme }) => {
|
||||
export const StyledQuickSearchTipButton = styled('div')(() => {
|
||||
return {
|
||||
...displayFlex('center', 'center'),
|
||||
marginTop: '12px',
|
||||
|
||||
Reference in New Issue
Block a user