fix: double link icon size error

This commit is contained in:
QiShaoXuan
2022-09-15 16:57:48 +08:00
parent 05f763651e
commit 3ab0564272
@@ -3,6 +3,7 @@ import React, { useCallback } from 'react';
import { useNavigate } from 'react-router-dom';
import { Descendant } from 'slate';
import { RenderElementProps } from 'slate-react';
import { styled } from '@toeverything/components/ui';
export type DoubleLinkElement = {
type: 'link';
@@ -13,6 +14,10 @@ export type DoubleLinkElement = {
id: string;
};
const StyledLink = styled('a')({
cursor: 'pointer',
});
export const DoubleLinkComponent = (props: RenderElementProps) => {
const { attributes, children, element } = props;
const doubleLinkElement = element as DoubleLinkElement;
@@ -32,15 +37,20 @@ export const DoubleLinkComponent = (props: RenderElementProps) => {
return (
<span onClick={handleClickLinkText}>
<a {...attributes} style={{ cursor: 'pointer' }}>
<StyledLink {...attributes}>
<PagesIcon
style={{ verticalAlign: 'middle', height: '20px' }}
style={{
verticalAlign: 'middle',
height: '1em',
fontSize: 'inherit',
marginBottom: '.2em',
}}
/>
<span>
{children}
{displayValue}
</span>
</a>
</StyledLink>
</span>
);
};