0
Fork 0
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:
Michael Barrett 2024-10-22 20:56:14 +01:00 committed by GitHub
parent e9914d8fe5
commit 63afb15356
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 2 deletions

View file

@ -1,6 +1,6 @@
{
"name": "@tryghost/admin-x-activitypub",
"version": "0.1.6",
"version": "0.1.7",
"license": "MIT",
"repository": {
"type": "git",

View file

@ -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