fix(component): click area of the item (#2221)

Co-authored-by: Himself65 <himself65@outlook.com>
This commit is contained in:
Fangdun Tsai
2023-05-04 13:46:56 +08:00
committed by GitHub
parent 3d43e61087
commit 238f69b4e7
3 changed files with 16 additions and 7 deletions

View File

@@ -9,7 +9,7 @@ export const StyledListItem = styled('div')<{
color: active color: active
? 'var(--affine-primary-color)' ? 'var(--affine-primary-color)'
: 'var(--affine-text-primary-color)', : 'var(--affine-text-primary-color)',
paddingLeft: '16px', paddingLeft: '2px',
paddingRight: '2px', paddingRight: '2px',
borderRadius: '8px', borderRadius: '8px',
cursor: 'pointer', cursor: 'pointer',
@@ -17,7 +17,7 @@ export const StyledListItem = styled('div')<{
position: 'relative', position: 'relative',
flexShrink: 0, flexShrink: 0,
userSelect: 'none', userSelect: 'none',
...displayFlex('flex-start', 'center'), ...displayFlex('flex-start', 'stretch'),
...(disabled ...(disabled
? { ? {
cursor: 'not-allowed', cursor: 'not-allowed',
@@ -25,8 +25,9 @@ export const StyledListItem = styled('div')<{
} }
: {}), : {}),
'> svg, a > svg': { 'a > svg, div > svg': {
fontSize: '20px', fontSize: '20px',
marginLeft: '14px',
marginRight: '12px', marginRight: '12px',
color: active color: active
? 'var(--affine-primary-color)' ? 'var(--affine-primary-color)'

View File

@@ -105,8 +105,17 @@ export const RootAppSidebar = ({
onOpenQuickSearchModal(); onOpenQuickSearchModal();
}, [onOpenQuickSearchModal])} }, [onOpenQuickSearchModal])}
> >
<SearchIcon /> <div
{t['Quick search']()} style={{
display: 'flex',
flex: 1,
alignItems: 'center',
justifyContent: 'flex-start',
}}
>
<SearchIcon />
{t['Quick search']()}
</div>
</StyledListItem> </StyledListItem>
<StyledListItem <StyledListItem
active={ active={

View File

@@ -69,7 +69,6 @@ export const changeLogSlideInStyle = style({
// fixme: if width is 100% and marginLeft is 0, // fixme: if width is 100% and marginLeft is 0,
// the UI will overflow on app sidebar // the UI will overflow on app sidebar
width: '99%', width: '99%',
marginLeft: '2px',
height: '32px', height: '32px',
display: 'flex', display: 'flex',
justifyContent: 'space-between', justifyContent: 'space-between',
@@ -78,7 +77,7 @@ export const changeLogSlideInStyle = style({
backgroundColor: 'var(--affine-tertiary-color)', backgroundColor: 'var(--affine-tertiary-color)',
border: '1px solid var(--affine-primary-color)', border: '1px solid var(--affine-primary-color)',
borderRight: 'none', borderRight: 'none',
paddingLeft: '8px', paddingLeft: '14px',
borderRadius: '16px 0 0 16px', borderRadius: '16px 0 0 16px',
cursor: 'pointer', cursor: 'pointer',
zIndex: 1001, zIndex: 1001,