|
|
|
@@ -8,6 +8,7 @@ export const createMiniTeaser = ({ |
|
|
|
link = '#', |
|
|
|
icon = 'Roboter', |
|
|
|
buttonlabel = 'IHK-Newsletter sichern', |
|
|
|
backgroundImage = null, |
|
|
|
}) => { |
|
|
|
|
|
|
|
if (type === 'standard') { |
|
|
|
@@ -19,13 +20,20 @@ export const createMiniTeaser = ({ |
|
|
|
return tile; |
|
|
|
}else{ |
|
|
|
const tile = createElement('div', ['tile', 'mini-teaser', type], null); |
|
|
|
if (backgroundImage && backgroundImage.length > 0) { |
|
|
|
tile.style = 'background-image: url(' + backgroundImage + ');'; |
|
|
|
tile.classList.add('background-image'); |
|
|
|
} |
|
|
|
const textBox = createElement('div', ['text-box'], null, tile); |
|
|
|
createElement('div', ['icon-box', 'pictogram-' + icon.toLowerCase().split(' ').join('-')], null, textBox); |
|
|
|
createElement('h4', ['title'], title, textBox); |
|
|
|
textBox.appendChild(createButton({color: 'white', label: buttonlabel,link: link, iconPosition: 'icon-right', icon: null})) |
|
|
|
if (icon && icon.length > 0) { |
|
|
|
createElement('div', ['icon-box', 'pictogram-' + icon.toLowerCase().split(' ').join('-')], null, textBox); |
|
|
|
createElement('h4', ['title'], title, textBox); |
|
|
|
textBox.appendChild(createButton({color: 'white', label: buttonlabel,link: link, iconPosition: 'icon-right', icon: null})) |
|
|
|
}else{ |
|
|
|
createElement('h4', ['title', 'noicon'], title, textBox); |
|
|
|
textBox.appendChild(createButton({color: 'white', label: buttonlabel,link: link, iconPosition: 'icon-right', icon: null})) |
|
|
|
} |
|
|
|
|
|
|
|
return tile; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |