Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

39 lignes
1.6 KiB

  1. import './miniteaser.scss';
  2. import {createElement} from "../../_global/scripts/helpers";
  3. import { createButton } from '../../atoms/button/ButtonComponent';
  4. export const createMiniTeaser = ({
  5. type = 'standard',
  6. category = 'IHK Mitgliedschaft',
  7. title = 'Werden Sie Teil unseres Netzwerks!',
  8. link = '#',
  9. icon = 'Roboter',
  10. buttonlabel = 'IHK-Newsletter sichern',
  11. backgroundImage = null,
  12. }) => {
  13. if (type === 'standard') {
  14. const tile = createElement('a', ['tile', 'mini-teaser', type], null);
  15. tile.href = link;
  16. const textBox = createElement('div', ['text-box'], null, tile);
  17. createElement('h5', ['category'], category, textBox);
  18. createElement('h4', ['title'], title, textBox);
  19. return tile;
  20. }else{
  21. const tile = createElement('div', ['tile', 'mini-teaser', type], null);
  22. if (backgroundImage && backgroundImage.length > 0) {
  23. tile.style = 'background-image: url(' + backgroundImage + ');';
  24. tile.classList.add('background-image');
  25. }
  26. const textBox = createElement('div', ['text-box'], null, tile);
  27. if (icon && icon.length > 0) {
  28. createElement('div', ['icon-box', 'pictogram-' + icon.toLowerCase().split(' ').join('-')], null, textBox);
  29. createElement('h4', ['title'], title, textBox);
  30. textBox.appendChild(createButton({color: 'white', label: buttonlabel,link: link, iconPosition: 'icon-right', icon: null}))
  31. }else{
  32. createElement('h4', ['title', 'noicon'], title, textBox);
  33. textBox.appendChild(createButton({color: 'white', label: buttonlabel,link: link, iconPosition: 'icon-right', icon: null}))
  34. }
  35. return tile;
  36. }
  37. }