| 1 |
import getIcon from '../../utils/get-icon'; |
| 2 |
import metadata from './block.json'; |
| 3 |
import edit from './edit'; |
| 4 |
import save from './save'; |
| 5 |
|
| 6 |
const { name } = metadata; |
| 7 |
|
| 8 |
export { metadata, name }; |
| 9 |
|
| 10 |
export const settings = { |
| 11 |
icon: getIcon('block-instagram', true), |
| 12 |
ghostkit: { |
| 13 |
// previewUrl: 'https://www.ghostkit.io/docs/blocks/instagram/', |
| 14 |
customStylesCallback(attributes) { |
| 15 |
const { gap, gapCustom } = attributes; |
| 16 |
|
| 17 |
const styles = { |
| 18 |
'--gkt-instagram--photos__gap': undefined, |
| 19 |
}; |
| 20 |
|
| 21 |
// Custom Gap. |
| 22 |
if ( |
| 23 |
gap === 'custom' && |
| 24 |
typeof gapCustom !== 'undefined' && |
| 25 |
gapCustom !== '' |
| 26 |
) { |
| 27 |
// we need to use `%` unit because of conflict with complex calc() and 0 value. |
| 28 |
const unit = gapCustom ? 'px' : '%'; |
| 29 |
|
| 30 |
styles['--gkt-instagram--photos__gap'] = `${gapCustom}${unit}`; |
| 31 |
} |
| 32 |
|
| 33 |
return styles; |
| 34 |
}, |
| 35 |
}, |
| 36 |
edit, |
| 37 |
save, |
| 38 |
}; |
| 39 |
|