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); const first = (i) => (i === 0);
return ( return (
<Mention <Mention
marginLeft={first(i) ? "-4px" : "0"} first={first(i)}
group={group} group={group}
scrollWindow={scrollWindow} scrollWindow={scrollWindow}
ship={content.mention} ship={content.mention}

View File

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