fix: double link icon size error
This commit is contained in:
@@ -3,6 +3,7 @@ import React, { useCallback } from 'react';
|
|||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { Descendant } from 'slate';
|
import { Descendant } from 'slate';
|
||||||
import { RenderElementProps } from 'slate-react';
|
import { RenderElementProps } from 'slate-react';
|
||||||
|
import { styled } from '@toeverything/components/ui';
|
||||||
|
|
||||||
export type DoubleLinkElement = {
|
export type DoubleLinkElement = {
|
||||||
type: 'link';
|
type: 'link';
|
||||||
@@ -13,6 +14,10 @@ export type DoubleLinkElement = {
|
|||||||
id: string;
|
id: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const StyledLink = styled('a')({
|
||||||
|
cursor: 'pointer',
|
||||||
|
});
|
||||||
|
|
||||||
export const DoubleLinkComponent = (props: RenderElementProps) => {
|
export const DoubleLinkComponent = (props: RenderElementProps) => {
|
||||||
const { attributes, children, element } = props;
|
const { attributes, children, element } = props;
|
||||||
const doubleLinkElement = element as DoubleLinkElement;
|
const doubleLinkElement = element as DoubleLinkElement;
|
||||||
@@ -32,15 +37,20 @@ export const DoubleLinkComponent = (props: RenderElementProps) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<span onClick={handleClickLinkText}>
|
<span onClick={handleClickLinkText}>
|
||||||
<a {...attributes} style={{ cursor: 'pointer' }}>
|
<StyledLink {...attributes}>
|
||||||
<PagesIcon
|
<PagesIcon
|
||||||
style={{ verticalAlign: 'middle', height: '20px' }}
|
style={{
|
||||||
|
verticalAlign: 'middle',
|
||||||
|
height: '1em',
|
||||||
|
fontSize: 'inherit',
|
||||||
|
marginBottom: '.2em',
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<span>
|
<span>
|
||||||
{children}
|
{children}
|
||||||
{displayValue}
|
{displayValue}
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</StyledLink>
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user