fix: text overflow problem in <a> tag (#2126)

This commit is contained in:
JimmFly
2023-04-26 00:40:14 +08:00
committed by GitHub
parent 1c41731b4e
commit 15a7e93058
3 changed files with 16 additions and 3 deletions

View File

@@ -165,7 +165,7 @@ export const WorkSpaceSliderBar: React.FC<WorkSpaceSliderBarProps> = ({
}}
>
<SettingsIcon />
{t('Workspace Settings')}
<div>{t('Workspace Settings')}</div>
</StyledLink>
</StyledListItem>
<StyledListItem

View File

@@ -9,7 +9,8 @@ export const StyledListItem = styled('div')<{
color: active
? 'var(--affine-primary-color)'
: 'var(--affine-text-primary-color)',
padding: '0 16px',
paddingLeft: '16px',
paddingRight: '2px',
borderRadius: '8px',
cursor: 'pointer',
marginBottom: '4px',

View File

@@ -1,4 +1,9 @@
import { baseTheme, displayFlex, styled } from '@affine/component';
import {
baseTheme,
displayFlex,
styled,
textEllipsis,
} from '@affine/component';
import Link from 'next/link';
const macosElectron = environment.isDesktop && environment.isMacOs;
@@ -71,6 +76,13 @@ export const StyledLink = styled(Link)(() => {
':visited': {
color: 'inherit',
},
overflow: 'hidden',
div: {
wordBreak: 'break-all',
wordWrap: 'break-word',
whiteSpace: 'nowrap',
...textEllipsis(1),
},
userDrag: 'none',
userSelect: 'none',
appRegion: 'no-drag',