mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-05 17:31:12 +00:00
Fix layout shift caused by "Who to follow" widget (#35861)
This commit is contained in:
parent
4f494781c1
commit
511e10df34
|
@ -19,6 +19,7 @@ import { DisplayName } from 'mastodon/components/display_name';
|
|||
import { FollowButton } from 'mastodon/components/follow_button';
|
||||
import { Icon } from 'mastodon/components/icon';
|
||||
import { IconButton } from 'mastodon/components/icon_button';
|
||||
import { LoadingIndicator } from 'mastodon/components/loading_indicator';
|
||||
import { VerifiedBadge } from 'mastodon/components/verified_badge';
|
||||
import { domain } from 'mastodon/initial_state';
|
||||
import { useAppDispatch, useAppSelector } from 'mastodon/store';
|
||||
|
@ -56,9 +57,7 @@ const messages = defineMessages({
|
|||
},
|
||||
});
|
||||
|
||||
const Source: React.FC<{
|
||||
id: ApiSuggestionSourceJSON;
|
||||
}> = ({ id }) => {
|
||||
const Source: React.FC<{ id: ApiSuggestionSourceJSON }> = ({ id }) => {
|
||||
const intl = useIntl();
|
||||
|
||||
let label, hint;
|
||||
|
@ -168,9 +167,9 @@ const Card: React.FC<{
|
|||
|
||||
const DISMISSIBLE_ID = 'home/follow-suggestions';
|
||||
|
||||
export const InlineFollowSuggestions: React.FC<{
|
||||
hidden?: boolean;
|
||||
}> = ({ hidden }) => {
|
||||
export const InlineFollowSuggestions: React.FC<{ hidden?: boolean }> = ({
|
||||
hidden,
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
const dispatch = useAppDispatch();
|
||||
const suggestions = useAppSelector((state) => state.suggestions.items);
|
||||
|
@ -288,13 +287,17 @@ export const InlineFollowSuggestions: React.FC<{
|
|||
ref={bodyRef}
|
||||
onScroll={handleScroll}
|
||||
>
|
||||
{suggestions.map((suggestion) => (
|
||||
<Card
|
||||
key={suggestion.account_id}
|
||||
id={suggestion.account_id}
|
||||
sources={suggestion.sources}
|
||||
/>
|
||||
))}
|
||||
{isLoading ? (
|
||||
<LoadingIndicator />
|
||||
) : (
|
||||
suggestions.map((suggestion) => (
|
||||
<Card
|
||||
key={suggestion.account_id}
|
||||
id={suggestion.account_id}
|
||||
sources={suggestion.sources}
|
||||
/>
|
||||
))
|
||||
)}
|
||||
</div>
|
||||
|
||||
{canScrollLeft && (
|
||||
|
|
|
@ -10448,8 +10448,10 @@ noscript {
|
|||
}
|
||||
|
||||
&__scrollable {
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
min-height: 228px;
|
||||
gap: 16px;
|
||||
padding: 16px;
|
||||
scroll-snap-type: x mandatory;
|
||||
|
|
Loading…
Reference in New Issue
Block a user