Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'mj-column': ['mc-button'],
'mj-hero': ['mc-button'],
'mc-button': [],
});
export default class McButton extends MjButton {
static endingTag = true
static allowedAttributes = {
...MjButton.allowedAttributes,
'mc:edit': 'string',
'mc:hideable': 'string',
}
static defaultAttributes = {
...MjButton.defaultAttributes,
'mc:hideable': false
}
isHideable() {
if (this.getAttribute('mc:hideable') !== false) {
return true
}
return false
}
// MODIFIED from https://github.com/mjmlio/mjml/blob/master/packages/mjml-button/src/index.js
render() {
const tag = this.getAttribute('href') ? 'a' : 'p'
return `
import MjButton from 'mjml-button'
import { BodyComponent } from 'mjml-core'
import { registerDependencies } from 'mjml-validator'
registerDependencies({
'mj-column': ['mc-button'],
'mj-hero': ['mc-button'],
'mc-button': [],
});
export default class McButton extends MjButton {
static endingTag = true
static allowedAttributes = {
...MjButton.allowedAttributes,
'mc:edit': 'string',
'mc:hideable': 'string',
}
static defaultAttributes = {
...MjButton.defaultAttributes,
'mc:hideable': false
}
isHideable() {
if (this.getAttribute('mc:hideable') !== false) {
return true
}
return false
}