chore: tweak all page styles (#2540)
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { TableBody, TableCell } from '@affine/component';
|
import { TableBody, TableCell } from '@affine/component';
|
||||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||||
import { useMediaQuery, useTheme } from '@mui/material';
|
import { useMediaQuery, useTheme } from '@mui/material';
|
||||||
|
import type { ReactNode } from 'react';
|
||||||
import { Fragment } from 'react';
|
import { Fragment } from 'react';
|
||||||
|
|
||||||
import { FavoriteTag } from './components/favorite-tag';
|
import { FavoriteTag } from './components/favorite-tag';
|
||||||
@@ -11,6 +12,23 @@ import type { DateKey, ListData } from './type';
|
|||||||
import { useDateGroup } from './use-date-group';
|
import { useDateGroup } from './use-date-group';
|
||||||
import { formatDate } from './utils';
|
import { formatDate } from './utils';
|
||||||
|
|
||||||
|
export const GroupRow = ({ children }: { children: ReactNode }) => {
|
||||||
|
return (
|
||||||
|
<StyledTableRow>
|
||||||
|
<TableCell
|
||||||
|
style={{
|
||||||
|
color: 'var(--affine-text-secondary-color)',
|
||||||
|
fontSize: 'var(--affine-font-sm)',
|
||||||
|
background: 'initial',
|
||||||
|
cursor: 'default',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</TableCell>
|
||||||
|
</StyledTableRow>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export const AllPagesBody = ({
|
export const AllPagesBody = ({
|
||||||
isPublicWorkspace,
|
isPublicWorkspace,
|
||||||
data,
|
data,
|
||||||
@@ -50,17 +68,7 @@ export const AllPagesBody = ({
|
|||||||
{groupName &&
|
{groupName &&
|
||||||
(index === 0 ||
|
(index === 0 ||
|
||||||
dataWithGroup[index - 1].groupName !== groupName) && (
|
dataWithGroup[index - 1].groupName !== groupName) && (
|
||||||
<StyledTableRow>
|
<GroupRow>{groupName}</GroupRow>
|
||||||
<TableCell
|
|
||||||
style={{
|
|
||||||
color: 'var(--affine-text-secondary-color)',
|
|
||||||
background: 'initial',
|
|
||||||
cursor: 'default',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{groupName}
|
|
||||||
</TableCell>
|
|
||||||
</StyledTableRow>
|
|
||||||
)}
|
)}
|
||||||
<StyledTableRow data-testid={`page-list-item-${pageId}`}>
|
<StyledTableRow data-testid={`page-list-item-${pageId}`}>
|
||||||
<TitleCell
|
<TitleCell
|
||||||
@@ -74,6 +82,7 @@ export const AllPagesBody = ({
|
|||||||
ellipsis={true}
|
ellipsis={true}
|
||||||
hidden={isSmallDevices}
|
hidden={isSmallDevices}
|
||||||
onClick={onClickPage}
|
onClick={onClickPage}
|
||||||
|
style={{ fontSize: 'var(--affine-font-xs)' }}
|
||||||
>
|
>
|
||||||
{formatDate(createDate)}
|
{formatDate(createDate)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
@@ -82,6 +91,7 @@ export const AllPagesBody = ({
|
|||||||
ellipsis={true}
|
ellipsis={true}
|
||||||
hidden={isSmallDevices}
|
hidden={isSmallDevices}
|
||||||
onClick={onClickPage}
|
onClick={onClickPage}
|
||||||
|
style={{ fontSize: 'var(--affine-font-xs)' }}
|
||||||
>
|
>
|
||||||
{formatDate(updatedDate ?? createDate)}
|
{formatDate(updatedDate ?? createDate)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ export const StyledTableCell = styled('td')<
|
|||||||
verticalAlign: 'middle',
|
verticalAlign: 'middle',
|
||||||
overflowWrap: 'break-word',
|
overflowWrap: 'break-word',
|
||||||
userSelect: 'none',
|
userSelect: 'none',
|
||||||
|
fontSize: 'var(--affine-font-sm)',
|
||||||
...(active ? { color: 'var(--affine-text-primary-color)' } : {}),
|
...(active ? { color: 'var(--affine-text-primary-color)' } : {}),
|
||||||
...(ellipsis ? textEllipsis(1) : {}),
|
...(ellipsis ? textEllipsis(1) : {}),
|
||||||
...(onClick ? { cursor: 'pointer' } : {}),
|
...(onClick ? { cursor: 'pointer' } : {}),
|
||||||
|
|||||||
Reference in New Issue
Block a user