25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 

40 satır
1.7 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('div', ['category','like-h5'], category, textBox);
  18. createElement('div', ['title','like-h4'], title, textBox);
  19. return tile;
  20. }else{
  21. const tile = createElement('a', ['tile', 'mini-teaser', type], null);
  22. tile.href = link;
  23. if (backgroundImage && backgroundImage.length > 0) {
  24. tile.style = 'background-image: url(' + backgroundImage + ');';
  25. tile.classList.add('background-image');
  26. }
  27. const textBox = createElement('div', ['text-box'], null, tile);
  28. if (icon && icon.length > 0) {
  29. createElement('div', ['icon-box', 'pictogram-' + icon.toLowerCase().split(' ').join('-')], null, textBox);
  30. createElement('div', ['title','like-h4'], title, textBox);
  31. textBox.appendChild(createButton({elementType: 'span',color: 'white', label: buttonlabel,iconPosition: 'icon-right', icon: null, preventClick: false}))
  32. }else{
  33. createElement('div', ['title', 'noicon', 'like-h4'], title, textBox);
  34. textBox.appendChild(createButton({elementType: 'span',color: 'white', label: buttonlabel, iconPosition: 'icon-right', icon: null, preventClick: false}))
  35. }
  36. return tile;
  37. }
  38. }