fix: Fix various UI text wrapping and overflow issues (#34774)
This commit is contained in:
parent
02ac18da51
commit
5dda094daa
5 changed files with 60 additions and 34 deletions
|
|
@ -7,10 +7,16 @@ import classNames from 'classnames';
|
|||
|
||||
export const AvatarGroup: React.FC<{
|
||||
compact?: boolean;
|
||||
avatarHeight?: number;
|
||||
children: React.ReactNode;
|
||||
}> = ({ children, compact = false }) => (
|
||||
}> = ({ children, compact = false, avatarHeight }) => (
|
||||
<div
|
||||
className={classNames('avatar-group', { 'avatar-group--compact': compact })}
|
||||
style={
|
||||
avatarHeight
|
||||
? ({ '--avatar-height': `${avatarHeight}px` } as React.CSSProperties)
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
import PropTypes from 'prop-types';
|
||||
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
|
||||
import { IconLogo } from 'mastodon/components/logo';
|
||||
import { AuthorLink } from 'mastodon/features/explore/components/author_link';
|
||||
|
||||
export const MoreFromAuthor = ({ accountId }) => (
|
||||
<div className='more-from-author'>
|
||||
<IconLogo />
|
||||
<FormattedMessage id='link_preview.more_from_author' defaultMessage='More from {name}' values={{ name: <AuthorLink accountId={accountId} /> }} />
|
||||
</div>
|
||||
);
|
||||
|
||||
MoreFromAuthor.propTypes = {
|
||||
accountId: PropTypes.string.isRequired,
|
||||
};
|
||||
21
app/javascript/mastodon/components/more_from_author.tsx
Normal file
21
app/javascript/mastodon/components/more_from_author.tsx
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { FormattedMessage } from 'react-intl';
|
||||
|
||||
import { IconLogo } from 'mastodon/components/logo';
|
||||
import { AuthorLink } from 'mastodon/features/explore/components/author_link';
|
||||
|
||||
export const MoreFromAuthor: React.FC<{ accountId: string }> = ({
|
||||
accountId,
|
||||
}) => (
|
||||
<FormattedMessage
|
||||
id='link_preview.more_from_author'
|
||||
defaultMessage='More from {name}'
|
||||
values={{ name: <AuthorLink accountId={accountId} /> }}
|
||||
>
|
||||
{(chunks) => (
|
||||
<div className='more-from-author'>
|
||||
<IconLogo />
|
||||
{chunks}
|
||||
</div>
|
||||
)}
|
||||
</FormattedMessage>
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue