More design tweaks for empty state in Featured tab > Collections (#38626)

This commit is contained in:
diondiondion 2026-04-09 16:37:39 +02:00 committed by GitHub
parent f429019f34
commit ef4a583f54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 11 deletions

View File

@ -10,7 +10,7 @@
} }
.content { .content {
max-width: 300px; max-width: 370px;
svg, svg,
img { img {

View File

@ -21,7 +21,7 @@ interface EmptyMessageProps {
hidden: boolean; hidden: boolean;
blockedBy: boolean; blockedBy: boolean;
accountId?: string; accountId?: string;
withImage?: boolean; withoutAddCollectionButton?: boolean;
} }
export const EmptyMessage: React.FC<EmptyMessageProps> = ({ export const EmptyMessage: React.FC<EmptyMessageProps> = ({
@ -29,7 +29,7 @@ export const EmptyMessage: React.FC<EmptyMessageProps> = ({
suspended, suspended,
hidden, hidden,
blockedBy, blockedBy,
withImage = true, withoutAddCollectionButton,
}) => { }) => {
const { acct } = useParams<{ acct?: string }>(); const { acct } = useParams<{ acct?: string }>();
const me = useCurrentAccountId(); const me = useCurrentAccountId();
@ -57,7 +57,7 @@ export const EmptyMessage: React.FC<EmptyMessageProps> = ({
const hasCollections = areCollectionsEnabled(); const hasCollections = areCollectionsEnabled();
const image = withImage && <ElephantImage />; const image = <ElephantImage />;
if (me === accountId) { if (me === accountId) {
if (hasCollections) { if (hasCollections) {
@ -78,12 +78,14 @@ export const EmptyMessage: React.FC<EmptyMessageProps> = ({
/> />
} }
> >
<Link to='/collections/new' className='button'> {!withoutAddCollectionButton && (
<FormattedMessage <Link to='/collections/new' className='button'>
id='empty_column.account_featured_self.no_collections_button' <FormattedMessage
defaultMessage='Create a collection' id='empty_column.account_featured_self.no_collections_button'
/> defaultMessage='Create a collection'
</Link> />
</Link>
)}
<Button secondary onClick={confirmHideFeaturedTab}> <Button secondary onClick={confirmHideFeaturedTab}>
<FormattedMessage <FormattedMessage
id='empty_column.account_featured_self.no_collections_hide_tab' id='empty_column.account_featured_self.no_collections_hide_tab'

View File

@ -179,7 +179,7 @@ const AccountFeatured: React.FC<{ multiColumn: boolean }> = ({
</ItemList> </ItemList>
) : ( ) : (
<EmptyMessage <EmptyMessage
withImage={false} withoutAddCollectionButton
blockedBy={blockedBy} blockedBy={blockedBy}
hidden={hidden} hidden={hidden}
suspended={suspended} suspended={suspended}