chat: positively apply margins to mentions

Fixes urbit/landscape#468
This commit is contained in:
James Acklin 2021-02-20 13:47:45 -05:00
parent ec7d8462f6
commit 018900ab74
2 changed files with 5 additions and 3 deletions

View File

@ -448,7 +448,7 @@ export const Message = ({
const first = (i) => (i === 0);
return (
<Mention
marginLeft={first(i) ? "-4px" : "0"}
first={first(i)}
group={group}
scrollWindow={scrollWindow}
ship={content.mention}

View File

@ -38,8 +38,9 @@ export function Mention(props: {
group: Group;
scrollWindow?: HTMLElement;
ship: string;
first?: Boolean;
}) {
const { contacts, ship, scrollWindow, ...rest } = props;
const { contacts, ship, scrollWindow, first, ...rest } = props;
let { contact } = props;
contact = contact?.color ? contact : contacts?.[ship];
const history = useHistory();
@ -56,7 +57,8 @@ export function Mention(props: {
<Box position='relative' display='inline-block' cursor='pointer' {...rest}>
<Text
onClick={() => toggleOverlay()}
mx={1}
marginLeft={first? 0 : 1}
marginRight={1}
px={1}
bg='washedBlue'
color='blue'