Skip to content

Commit

Permalink
fix: ellipsis when author is too long for quote or authortext
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilb committed Jul 12, 2023
1 parent 873a2d5 commit 9261408
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ts/components/conversation/ContactName.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import classNames from 'classnames';

import { Emojify } from './Emojify';
import { useConversationUsernameOrShorten, useIsPrivate } from '../../hooks/useParamSelector';
import { CSSProperties } from 'styled-components';

type Props = {
pubkey: string;
Expand Down Expand Up @@ -33,9 +34,10 @@ export const ContactName = (props: Props) => {
className={classNames(prefix, compact && 'compact')}
dir="auto"
data-testid={`${prefix}__profile-name`}
style={{ textOverflow: 'inherit' }}
>
{shouldShowProfile ? (
<span style={styles as any} className={`${prefix}__profile-name`}>
<span style={styles as CSSProperties} className={`${prefix}__profile-name`}>
<Emojify text={textProfile} sizeClass="small" isGroup={!isPrivate} />
</span>
) : null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type Props = {

const StyledAuthorContainer = styled(Flex)`
color: var(--text-primary-color);
text-overflow: ellipsis;
`;

export const MessageAuthorText = (props: Props) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ const StyledMessageOpaqueContent = styled(StyledMessageHighlighter)<{
align-self: ${props => (props.messageDirection === 'incoming' ? 'flex-start' : 'flex-end')};
padding: var(--padding-message-content);
border-radius: var(--border-radius-message-box);
max-width: 100%;
`;

export const IsMessageVisibleContext = createContext(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ const StyledMessageContentContainer = styled.div<{ direction: 'left' | 'right' }

const StyledMessageWithAuthor = styled.div<{ isIncoming: boolean }>`
max-width: ${props => (props.isIncoming ? '100%' : 'calc(100% - 17px)')};
display: flex;
flex-direction: column;
min-width: 0;
`;

export const MessageContentWithStatuses = (props: Props) => {
Expand Down

0 comments on commit 9261408

Please sign in to comment.