1
0
mirror of https://github.com/dwaxweiler/connector-mobilizon synced 2025-06-05 21:59:25 +02:00

improve loading indicator

This commit is contained in:
Daniel Waxweiler
2022-06-06 12:42:49 +02:00
parent 456b4a9da1
commit c4c3b11baf
6 changed files with 63 additions and 34 deletions

View File

@ -5,23 +5,25 @@ const { __ } = wp.i18n
const NAME = '<wordpress-name>'
export default ({ attributes }) => {
const blockProps = useBlockProps.save()
const blockProps = useBlockProps.save({
className: NAME + '_events-list',
})
return (
<div
className={NAME + '_events-list'}
data-maximum={attributes.eventsCount}
data-group-name={attributes.groupName}
{...blockProps}
>
<div style={{ display: 'none' }}>
<div className="general-error" style={{ display: 'none' }}>
{__('The events could not be loaded!', '<wordpress-name>')}
</div>
<div style={{ display: 'none' }}>
<div className="group-not-found" style={{ display: 'none' }}>
{__('The group could not be found!', '<wordpress-name>')}
</div>
<ul>
<li>{__('Loading...', '<wordpress-name>')}</li>
</ul>
<div className="loading-indicator" style={{ display: 'none' }}>
{__('Loading...', '<wordpress-name>')}
</div>
<ul></ul>
</div>
)
}