Skip to content

Commit

Permalink
Add empty state message for follow recommendations in web UI (mastodo…
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargron authored and chrisguida committed Feb 26, 2022
1 parent 2ec9cc0 commit 6d6666b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/javascript/mastodon/features/follow_recommendations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,14 @@ class FollowRecommendations extends ImmutablePureComponent {

{!isLoading && (
<React.Fragment>
<div>
{suggestions.map(suggestion => (
<div className='column-list'>
{suggestions.size > 0 ? suggestions.map(suggestion => (
<Account key={suggestion.get('account')} id={suggestion.get('account')} />
))}
)) : (
<div className='column-list__empty-message'>
<FormattedMessage id='empty_column.follow_recommendations' defaultMessage='Looks like no suggestions could be generated for you. You can try using search to look for people you might know or explore trending hashtags.' />
</div>
)}
</div>

<div className='column-actions'>
Expand Down
16 changes: 16 additions & 0 deletions app/javascript/styles/mastodon/components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2525,6 +2525,22 @@ a.account__display-name {
}
}

.column-list {
margin: 0 20px;
border: 1px solid lighten($ui-base-color, 8%);
background: darken($ui-base-color, 2%);
border-radius: 4px;

&__empty-message {
padding: 40px;
text-align: center;
font-size: 16px;
line-height: 24px;
font-weight: 400;
color: $darker-text-color;
}
}

.compose-panel {
width: 285px;
margin-top: 10px;
Expand Down

0 comments on commit 6d6666b

Please sign in to comment.