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:
Vitaly Barakov
2025-11-07 11:30:54 +08:00
committed by GitHub
parent 2bd9f1a353
commit 5a2f508dac
2 changed files with 18 additions and 3 deletions

View File

@@ -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',
},
},
});

View File

@@ -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 => {