Merge pull request #4995 from urbit/james/shipname-titles

interface: consistent  titles for mentions, authors with nicknames
This commit is contained in:
matildepark 2021-06-14 15:57:15 -05:00 committed by GitHub
commit 5241efbfa8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 5 deletions

View File

@ -159,7 +159,7 @@ export const MessageAuthor = ({
fontWeight={nameMono ? '400' : '500'}
cursor='pointer'
onClick={doCopy}
title={`~${msg.author}`}
title={showNickname ? `~${msg.author}` : contact?.nickname}
>
{copyDisplay}
</Text>

View File

@ -1,4 +1,4 @@
import { BaseImage, Box, Row } from '@tlon/indigo-react';
import { BaseImage, Box, Row, Text } from '@tlon/indigo-react';
import moment from 'moment';
import React, { ReactElement, ReactNode } from 'react';
import GlobalApi from '~/logic/api/global';
@ -94,7 +94,7 @@ export default function Author(props: AuthorProps & PropFunc<typeof Box>): React
)}
</Box>
<Box display='flex' alignItems='baseline'>
<Box
<Text
ml={showImage ? 2 : 0}
color='black'
fontSize='1'
@ -104,10 +104,11 @@ export default function Author(props: AuthorProps & PropFunc<typeof Box>): React
fontWeight={showNickname ? '500' : '400'}
mr={showNickname ? 0 : '2px'}
mt={showNickname ? 0 : '0px'}
title={showNickname ? cite(ship) : contact?.nickname}
onClick={doCopy}
>
{copyDisplay}
</Box>
</Text>
{ !dontShowTime && time && (
<Timestamp
height="fit-content"

View File

@ -46,7 +46,6 @@ export function Mention(props: {
const contact = useContact(`~${deSig(ship)}`);
const showNickname = useShowNickname(contact);
const name = showNickname ? contact?.nickname : cite(ship);
return (
<ProfileOverlay ship={ship} api={api} display="inline">
<Text
@ -57,6 +56,8 @@ export function Mention(props: {
color='blue'
fontSize={showNickname ? 1 : 0}
mono={!showNickname}
title={showNickname ? cite(ship) : contact?.nickname}
{...rest}
>
{name}
</Text>