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 { cssVarV2 } from '@toeverything/theme/v2';
|
||||||
import { style } from '@vanilla-extract/css';
|
import { globalStyle, style } from '@vanilla-extract/css';
|
||||||
|
|
||||||
export const docIconPickerTrigger = style({
|
export const docIconPickerTrigger = style({
|
||||||
width: 64,
|
width: 64,
|
||||||
@@ -35,3 +35,11 @@ export const placeholderContentText = style({
|
|||||||
color: cssVarV2.text.secondary,
|
color: cssVarV2.text.secondary,
|
||||||
fontSize: 12,
|
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';
|
import * as styles from './doc-icon-picker.css';
|
||||||
|
|
||||||
const TitleContainer = ({ children }: { children: React.ReactNode }) => {
|
const TitleContainer = ({
|
||||||
|
children,
|
||||||
|
hasIcon,
|
||||||
|
}: {
|
||||||
|
children: React.ReactNode;
|
||||||
|
hasIcon: boolean;
|
||||||
|
}) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="doc-icon-container"
|
className="doc-icon-container"
|
||||||
|
data-has-icon={hasIcon ? 'true' : 'false'}
|
||||||
style={{
|
style={{
|
||||||
paddingBottom: 8,
|
paddingBottom: 8,
|
||||||
}}
|
}}
|
||||||
@@ -45,7 +52,7 @@ export const DocIconPicker = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TitleContainer>
|
<TitleContainer hasIcon={!isPlaceholder}>
|
||||||
<IconEditor
|
<IconEditor
|
||||||
icon={icon?.icon}
|
icon={icon?.icon}
|
||||||
onIconChange={data => {
|
onIconChange={data => {
|
||||||
|
|||||||
Reference in New Issue
Block a user