mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Added button to show more followers on profile in admin-x-activitypub (#21371)
no refs
This commit is contained in:
parent
e9914d8fe5
commit
63afb15356
2 changed files with 15 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@tryghost/admin-x-activitypub",
|
||||
"version": "0.1.6",
|
||||
"version": "0.1.7",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -35,6 +35,12 @@ const Profile: React.FC<ProfileProps> = ({}) => {
|
|||
|
||||
const layout = 'feed';
|
||||
|
||||
const [visibleFollowers, setVisibleFollowers] = useState(30);
|
||||
|
||||
const loadMoreFollowers = () => {
|
||||
setVisibleFollowers(prev => prev + 30);
|
||||
};
|
||||
|
||||
const tabs = [
|
||||
{
|
||||
id: 'posts',
|
||||
|
@ -149,7 +155,7 @@ const Profile: React.FC<ProfileProps> = ({}) => {
|
|||
</NoValueLabel>
|
||||
) : (
|
||||
<List>
|
||||
{followers.map((item) => {
|
||||
{followers.slice(0, visibleFollowers).map((item) => {
|
||||
return (
|
||||
<ActivityItem key={item.id} url={item.url}>
|
||||
<APAvatar author={item} />
|
||||
|
@ -164,6 +170,13 @@ const Profile: React.FC<ProfileProps> = ({}) => {
|
|||
})}
|
||||
</List>
|
||||
)}
|
||||
{visibleFollowers < followers.length && (
|
||||
<Button
|
||||
className='mt-4'
|
||||
label='Load More'
|
||||
onClick={loadMoreFollowers}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
),
|
||||
counter: followersCount
|
||||
|
|
Loading…
Reference in a new issue