wordpress-activitypub/src/followers/view.js
Matt Wiebe 5b9dadd6fd
Followers Block (#344)
Introduces a new Followers block. Proudly display your Fediverse followers to the world!

---------

Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>
2023-07-26 15:05:41 -05:00

12 lines
No EOL
408 B
JavaScript

import './style.scss';
import { Followers } from './followers';
import { render } from '@wordpress/element';
import domReady from '@wordpress/dom-ready';
domReady( () => {
// iterate over a nodelist
[].forEach.call( document.querySelectorAll( '.activitypub-follower-block' ), ( element ) => {
const attrs = JSON.parse( element.dataset.attrs );
render( <Followers { ...attrs } />, element );
} );
} );