mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-11 22:18:54 +08:00
feat(core): add link to template tutorial (#10189)
This commit is contained in:
@@ -16,5 +16,28 @@ export const scrollableViewport = style({
|
|||||||
maxHeight: 360,
|
maxHeight: 360,
|
||||||
});
|
});
|
||||||
export const emptyIcon = style({
|
export const emptyIcon = style({
|
||||||
|
fontSize: 20,
|
||||||
color: cssVarV2.icon.primary,
|
color: cssVarV2.icon.primary,
|
||||||
});
|
});
|
||||||
|
export const empty = style({
|
||||||
|
pointerEvents: 'none',
|
||||||
|
display: 'flex',
|
||||||
|
gap: 8,
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
alignItems: 'center',
|
||||||
|
lineHeight: '20px',
|
||||||
|
padding: 4,
|
||||||
|
});
|
||||||
|
export const emptyText = style({
|
||||||
|
color: cssVarV2.text.secondary,
|
||||||
|
});
|
||||||
|
export const link = style({
|
||||||
|
lineHeight: 0,
|
||||||
|
pointerEvents: 'auto',
|
||||||
|
fontSize: 20,
|
||||||
|
color: cssVarV2.icon.primary,
|
||||||
|
});
|
||||||
|
export const space = style({
|
||||||
|
width: 0,
|
||||||
|
flex: 1,
|
||||||
|
});
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
import { Menu, MenuItem, type MenuProps, Scrollable } from '@affine/component';
|
import {
|
||||||
|
IconButton,
|
||||||
|
Menu,
|
||||||
|
MenuItem,
|
||||||
|
type MenuProps,
|
||||||
|
Scrollable,
|
||||||
|
} from '@affine/component';
|
||||||
import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks';
|
import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks';
|
||||||
import { useI18n } from '@affine/i18n';
|
import { useI18n } from '@affine/i18n';
|
||||||
import { InformationIcon } from '@blocksuite/icons/rc';
|
import { DualLinkIcon, InformationIcon } from '@blocksuite/icons/rc';
|
||||||
import { useLiveData, useService } from '@toeverything/infra';
|
import { useLiveData, useService } from '@toeverything/infra';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
|
|
||||||
@@ -47,12 +53,21 @@ const DocItem = ({ doc, onSelect, asLink }: DocItemProps) => {
|
|||||||
const Empty = () => {
|
const Empty = () => {
|
||||||
const t = useI18n();
|
const t = useI18n();
|
||||||
return (
|
return (
|
||||||
<MenuItem
|
<div className={styles.empty}>
|
||||||
disabled
|
<InformationIcon className={styles.emptyIcon} />
|
||||||
prefixIcon={<InformationIcon className={styles.emptyIcon} />}
|
<span className={styles.emptyText}>
|
||||||
>
|
{t['com.affine.template-list.empty']()}
|
||||||
{t['com.affine.template-list.empty']()}
|
</span>
|
||||||
</MenuItem>
|
<div className={styles.space} />
|
||||||
|
<a
|
||||||
|
href="https://affine.pro/blog/how-to-use-template"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className={styles.link}
|
||||||
|
>
|
||||||
|
<IconButton icon={<DualLinkIcon />} />
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user