|
4 | 4 | import { __ } from '@wordpress/i18n';
|
5 | 5 |
|
6 | 6 | const variations = [
|
| 7 | + { |
| 8 | + name: 'top-artists', |
| 9 | + title: __( 'Top Artists', 'profile-blocks-lastfm' ), |
| 10 | + description: __( 'Display the top artists of a user.', 'profile-blocks-lastfm' ), |
| 11 | + attributes: { collection: 'artists' }, |
| 12 | + innerBlocks: [ |
| 13 | + [ 'core/heading', { level: 3, content: __( 'Top Artists', 'profile-blocks-lastfm' ) } ], |
| 14 | + [ 'profile-blocks-lastfm/dynamic-template', { layout: { type: 'flex' } }, [ |
| 15 | + [ 'profile-blocks-lastfm/item-image', { itemImageProp: 'artist.images', itemLinkProp: 'artist.url' } ], |
| 16 | + [ 'core/group', { layout: { type: 'flex', flexWrap: 'nowrap', orientation: 'vertical' }, style: { layout: { selfStretch: 'fill' }, spacing: { blockGap: '0' } } }, [ |
| 17 | + [ 'profile-blocks-lastfm/item-name', { itemTextProp: 'artist.name', itemLinkProp: 'artist.url', isLink: true, style: { typography: { fontStyle: 'normal', fontWeight: 700 } } } ], |
| 18 | + ] ], |
| 19 | + [ 'core/group', { layout: { type: 'flex', flexWrap: 'nowrap' }, style: { spacing: { blockGap: '0.25em' }, typography: { fontSize: '0.8em' } } }, [ |
| 20 | + [ 'profile-blocks-lastfm/item-name', { itemTextProp: 'artist.playcount' } ], |
| 21 | + [ 'core/paragraph', { content: __( 'plays', 'profile-blocks-lastfm' ) } ], |
| 22 | + ] ], |
| 23 | + ] ], |
| 24 | + ], |
| 25 | + }, |
7 | 26 | {
|
8 | 27 | name: 'top-albums',
|
9 | 28 | title: __( 'Top Albums', 'profile-blocks-lastfm' ),
|
10 | 29 | description: __( 'Display the top albums of a user.', 'profile-blocks-lastfm' ),
|
11 | 30 | attributes: { collection: 'albums' },
|
| 31 | + innerBlocks: [ |
| 32 | + [ 'core/heading', { level: 3, content: __( 'Top Albums', 'profile-blocks-lastfm' ) } ], |
| 33 | + [ 'profile-blocks-lastfm/dynamic-template', { layout: { type: 'flex' } }, [ |
| 34 | + [ 'profile-blocks-lastfm/item-image', { itemImageProp: 'album.images', itemLinkProp: 'album.url' } ], |
| 35 | + [ 'core/group', { layout: { type: 'flex', flexWrap: 'nowrap', orientation: 'vertical' }, style: { layout: { selfStretch: 'fill' }, spacing: { blockGap: '0' } } }, [ |
| 36 | + [ 'profile-blocks-lastfm/item-name', { itemTextProp: 'album.name', itemLinkProp: 'album.url', isLink: true, style: { typography: { fontStyle: 'normal', fontWeight: 700 } } } ], |
| 37 | + [ 'profile-blocks-lastfm/item-name', { itemTextProp: 'artist.name', itemLinkProp: 'artist.url', isLink: true, style: { typography: { fontSize: '0.8em' } } } ], |
| 38 | + ] ], |
| 39 | + [ 'core/group', { layout: { type: 'flex', flexWrap: 'nowrap' }, style: { spacing: { blockGap: '0.25em' }, typography: { fontSize: '0.8em' } } }, [ |
| 40 | + [ 'profile-blocks-lastfm/item-name', { itemTextProp: 'album.playcount' } ], |
| 41 | + [ 'core/paragraph', { content: __( 'plays', 'profile-blocks-lastfm' ) } ], |
| 42 | + ] ], |
| 43 | + ] ], |
| 44 | + ], |
12 | 45 | isDefault: true,
|
13 | 46 | },
|
14 |
| - { |
15 |
| - name: 'top-artists', |
16 |
| - title: __( 'Top Artists', 'profile-blocks-lastfm' ), |
17 |
| - description: __( 'Display the top artists of a user.', 'profile-blocks-lastfm' ), |
18 |
| - attributes: { collection: 'artists' }, |
19 |
| - }, |
20 | 47 | {
|
21 | 48 | name: 'top-tracks',
|
22 | 49 | title: __( 'Top Tracks', 'profile-blocks-lastfm' ),
|
23 | 50 | description: __( 'Display the top tracks of a user.', 'profile-blocks-lastfm' ),
|
24 | 51 | attributes: { collection: 'tracks' },
|
| 52 | + innerBlocks: [ |
| 53 | + [ 'core/heading', { level: 3, content: __( 'Top Tracks here', 'profile-blocks-lastfm' ) } ], |
| 54 | + [ 'profile-blocks-lastfm/dynamic-template', { layout: { type: 'flex' } }, [ |
| 55 | + [ 'profile-blocks-lastfm/item-image', { itemImageProp: 'track.images', itemLinkProp: 'track.url' } ], |
| 56 | + [ 'core/group', { layout: { type: 'flex', flexWrap: 'nowrap', orientation: 'vertical' }, style: { layout: { selfStretch: 'fill' }, spacing: { blockGap: '0' } } }, [ |
| 57 | + [ 'profile-blocks-lastfm/item-name', { itemTextProp: 'track.name', itemLinkProp: 'track.url', isLink: true, style: { typography: { fontStyle: 'normal', fontWeight: 700 } } } ], |
| 58 | + [ 'profile-blocks-lastfm/item-name', { itemTextProp: 'artist.name', itemLinkProp: 'artist.url', isLink: true, style: { typography: { fontSize: '0.8em' } } } ], |
| 59 | + ] ], |
| 60 | + [ 'core/group', { layout: { type: 'flex', flexWrap: 'nowrap' }, style: { spacing: { blockGap: '0.25em' }, typography: { fontSize: '0.8em' } } }, [ |
| 61 | + [ 'profile-blocks-lastfm/item-name', { itemTextProp: 'track.playcount' } ], |
| 62 | + [ 'core/paragraph', { content: __( 'plays', 'profile-blocks-lastfm' ) } ], |
| 63 | + ] ], |
| 64 | + ] ], |
| 65 | + ], |
25 | 66 | },
|
26 | 67 | ];
|
27 | 68 |
|
|
0 commit comments