mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
feat(editor): hidden 'add icon' label on print if icon is not set (#13868)
This caption (see screenshot) is added when you try to print doc, even if there is no icon. <img width="1269" height="897" alt="изображение" src="https://github.com/user-attachments/assets/d63383e6-48a2-44fb-8f32-ae91d1e9e8c6" />
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { cssVarV2 } from '@toeverything/theme/v2';
|
||||
import { style } from '@vanilla-extract/css';
|
||||
import { globalStyle, style } from '@vanilla-extract/css';
|
||||
|
||||
export const docIconPickerTrigger = style({
|
||||
width: 64,
|
||||
@@ -35,3 +35,11 @@ export const placeholderContentText = style({
|
||||
color: cssVarV2.text.secondary,
|
||||
fontSize: 12,
|
||||
});
|
||||
|
||||
globalStyle('.doc-icon-container[data-has-icon="false"]', {
|
||||
'@media': {
|
||||
print: {
|
||||
display: 'none',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -6,10 +6,17 @@ import { useLiveData, useService } from '@toeverything/infra';
|
||||
|
||||
import * as styles from './doc-icon-picker.css';
|
||||
|
||||
const TitleContainer = ({ children }: { children: React.ReactNode }) => {
|
||||
const TitleContainer = ({
|
||||
children,
|
||||
hasIcon,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
hasIcon: boolean;
|
||||
}) => {
|
||||
return (
|
||||
<div
|
||||
className="doc-icon-container"
|
||||
data-has-icon={hasIcon ? 'true' : 'false'}
|
||||
style={{
|
||||
paddingBottom: 8,
|
||||
}}
|
||||
@@ -45,7 +52,7 @@ export const DocIconPicker = ({
|
||||
}
|
||||
|
||||
return (
|
||||
<TitleContainer>
|
||||
<TitleContainer hasIcon={!isPlaceholder}>
|
||||
<IconEditor
|
||||
icon={icon?.icon}
|
||||
onIconChange={data => {
|
||||
|
||||
Reference in New Issue
Block a user