fix: wrap reactors list in popup so we don't have overflow

pull/2463/head
William Grant 3 years ago
parent 9251e7687f
commit 8879893798

@ -12,7 +12,7 @@ export const StyledPopupContainer = styled.div<{ tooltipPosition: TipPosition }>
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
width: 216px; width: 244px;
height: 72px; height: 72px;
z-index: 5; z-index: 5;
@ -56,6 +56,13 @@ const StyledEmoji = styled.span`
margin-left: 8px; margin-left: 8px;
`; `;
const StyledContacts = styled.span`
word-break: break-all;
span {
word-break: keep-all;
}
`;
const StyledOthers = styled.span<{ darkMode: boolean }>` const StyledOthers = styled.span<{ darkMode: boolean }>`
color: ${props => (props.darkMode ? 'var(--color-accent)' : 'var(--color-text)')}; color: ${props => (props.darkMode ? 'var(--color-accent)' : 'var(--color-text)')};
`; `;
@ -96,7 +103,7 @@ const Contacts = (contacts: Array<string>, count: number) => {
const reactors = contacts.length; const reactors = contacts.length;
if (reactors === 1 || reactors === 2 || reactors === 3) { if (reactors === 1 || reactors === 2 || reactors === 3) {
return ( return (
<span> <StyledContacts>
{window.i18n( {window.i18n(
reactors === 1 reactors === 1
? 'reactionPopupOne' ? 'reactionPopupOne'
@ -105,18 +112,18 @@ const Contacts = (contacts: Array<string>, count: number) => {
: 'reactionPopupThree', : 'reactionPopupThree',
contacts contacts
)}{' '} )}{' '}
{window.i18n('reactionPopup')} <span>{window.i18n('reactionPopup')}</span>
</span> </StyledContacts>
); );
} else if (reactors > 3) { } else if (reactors > 3) {
return ( return (
<span> <StyledContacts>
{window.i18n('reactionPopupMany', [contacts[0], contacts[1], contacts[3]])}{' '} {window.i18n('reactionPopupMany', [contacts[0], contacts[1], contacts[3]])}{' '}
<StyledOthers darkMode={darkMode}> <StyledOthers darkMode={darkMode}>
{window.i18n(reactors === 4 ? 'otherSingular' : 'otherPlural', [`${count - 3}`])} {window.i18n(reactors === 4 ? 'otherSingular' : 'otherPlural', [`${count - 3}`])}
</StyledOthers>{' '} </StyledOthers>{' '}
{window.i18n('reactionPopup')} <span>{window.i18n('reactionPopup')}</span>
</span> </StyledContacts>
); );
} else { } else {
return null; return null;

Loading…
Cancel
Save