OmniboxResult: truncate long titles

Fixes urbit/landscape#545
This commit is contained in:
Matilde Park 2021-03-23 14:31:05 -04:00
parent 33cdb327b6
commit eeafd10b96

View File

@ -64,7 +64,7 @@ export class OmniboxResult extends Component {
graphic = <Icon display='inline-block' verticalAlign='middle' icon='Users' mr='2' size='18px' color={iconFill} />; graphic = <Icon display='inline-block' verticalAlign='middle' icon='Users' mr='2' size='18px' color={iconFill} />;
} else if (icon === 'tutorial') { } else if (icon === 'tutorial') {
graphic = <Icon display='inline-block' verticalAlign='middle' icon='Tutorial' mr='2' size='18px' color={iconFill} />; graphic = <Icon display='inline-block' verticalAlign='middle' icon='Tutorial' mr='2' size='18px' color={iconFill} />;
} }
else { else {
graphic = <Icon display='inline-block' icon='NullIcon' verticalAlign="middle" mr='2' size="16px" color={iconFill} />; graphic = <Icon display='inline-block' icon='NullIcon' verticalAlign="middle" mr='2' size="16px" color={iconFill} />;
} }
@ -102,6 +102,12 @@ export class OmniboxResult extends Component {
<Text <Text
mono={(icon == 'profile' && text.startsWith('~'))} mono={(icon == 'profile' && text.startsWith('~'))}
color={this.state.hovered || selected === link ? 'white' : 'black'} color={this.state.hovered || selected === link ? 'white' : 'black'}
display='inline-block'
verticalAlign='middle'
width='100%'
overflow='hidden'
textOverflow='ellipsis'
whiteSpace='pre'
mr='1' mr='1'
> >
{text.startsWith("~") ? cite(text) : text} {text.startsWith("~") ? cite(text) : text}