Merge pull request #4501 from urbit/mp/leap/status-truncate

leap: truncate statuses
This commit is contained in:
matildepark 2021-02-25 22:22:32 -05:00 committed by GitHub
commit 29b4d2bbd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,7 @@ import React, { Component } from 'react';
import { Box, Row, Icon, Text } from '@tlon/indigo-react';
import defaultApps from '~/logic/lib/default-apps';
import Sigil from '~/logic/lib/sigil';
import { uxToHex } from '~/logic/lib/util';
import { uxToHex, cite } from '~/logic/lib/util';
export class OmniboxResult extends Component {
constructor(props) {
@ -87,25 +87,29 @@ export class OmniboxResult extends Component {
}
onClick={navigate}
width="100%"
justifyContent="space-between"
ref={this.result}
>
<Box display="flex" verticalAlign="middle" maxWidth="60%" flexShrink={0}>
{graphic}
<Text
display="inline-block"
verticalAlign="middle"
mono={(icon == 'profile' && text.startsWith('~'))}
color={this.state.hovered || selected === link ? 'white' : 'black'}
maxWidth="60%"
style={{ flexShrink: 0 }}
mr='1'
>
{text}
{text.startsWith("~") ? cite(text) : text}
</Text>
</Box>
<Text pr='2'
display="inline-block"
verticalAlign="middle"
color={this.state.hovered || selected === link ? 'white' : 'black'}
width='100%'
minWidth={0}
textOverflow="ellipsis"
whiteSpace="pre"
overflow="hidden"
maxWidth="40%"
textAlign='right'
>
{subtext}