|
|
@ -1,9 +1,11 @@ |
|
|
|
import { FC, useEffect, useState } from 'react'; |
|
|
|
import { FC, useEffect, useState } from 'react'; |
|
|
|
import { Col, Pagination, Row, Skeleton } from 'antd'; |
|
|
|
import { Col, Pagination, Row, Skeleton } from 'antd'; |
|
|
|
|
|
|
|
import { ErrorBoundary } from 'react-error-boundary'; |
|
|
|
import { Follower } from '../../../../interfaces/follower'; |
|
|
|
import { Follower } from '../../../../interfaces/follower'; |
|
|
|
import { SingleFollower } from '../SingleFollower/SingleFollower'; |
|
|
|
import { SingleFollower } from '../SingleFollower/SingleFollower'; |
|
|
|
import styles from './FollowerCollection.module.scss'; |
|
|
|
import styles from './FollowerCollection.module.scss'; |
|
|
|
import { FollowButton } from '../../../action-buttons/FollowButton'; |
|
|
|
import { FollowButton } from '../../../action-buttons/FollowButton'; |
|
|
|
|
|
|
|
import { ComponentError } from '../../ComponentError/ComponentError'; |
|
|
|
|
|
|
|
|
|
|
|
export type FollowerCollectionProps = { |
|
|
|
export type FollowerCollectionProps = { |
|
|
|
name: string; |
|
|
|
name: string; |
|
|
@ -67,6 +69,16 @@ export const FollowerCollection: FC<FollowerCollectionProps> = ({ name, onFollow |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
|
|
|
|
<ErrorBoundary |
|
|
|
|
|
|
|
// eslint-disable-next-line react/no-unstable-nested-components
|
|
|
|
|
|
|
|
fallbackRender={({ error, resetErrorBoundary }) => ( |
|
|
|
|
|
|
|
<ComponentError |
|
|
|
|
|
|
|
componentName="FollowerCollection" |
|
|
|
|
|
|
|
message={error.message} |
|
|
|
|
|
|
|
retryFunction={resetErrorBoundary} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
> |
|
|
|
<div className={styles.followers} id="followers-collection"> |
|
|
|
<div className={styles.followers} id="followers-collection"> |
|
|
|
<Row wrap gutter={[10, 10]} className={styles.followerRow}> |
|
|
|
<Row wrap gutter={[10, 10]} className={styles.followerRow}> |
|
|
|
{followers.map(follower => ( |
|
|
|
{followers.map(follower => ( |
|
|
@ -89,5 +101,6 @@ export const FollowerCollection: FC<FollowerCollectionProps> = ({ name, onFollow |
|
|
|
hideOnSinglePage |
|
|
|
hideOnSinglePage |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</ErrorBoundary> |
|
|
|
); |
|
|
|
); |
|
|
|
}; |
|
|
|
}; |
|
|
|